Error while executing ./docker-build.sh in GeoNode - windows-subsystem-for-linux

(my_geonode) (base) femi_val#MSI:~/my_geonode$ ./docker-build.sh
WARNING: The COMPOSE_PROJECT_NAME variable is not set. Defaulting to a blank string.
WARNING: The HTTPS_HOST variable is not set. Defaulting to a blank string.

Related

g++ compilation fails when profiling enabled

I have a working program, which I want to profile. Thus, I just added a -pg switch to the Makefile. This gives thousands of repetitions of this same message:
/tmp/ccOlI4CC.s:62095: Error: bad expression
/tmp/ccOlI4CC.s:62095: Error: junk `mcount#GOTPCREL(%rip)' after expression
/tmp/ccOlI4CC.s:62417: Error: bad expression
/tmp/ccOlI4CC.s:62417: Error: junk `mcount#GOTPCREL(%rip)' after expression
I'm in the blue. What can I do about this?
The problem was solved by removing the -masm=intel flag.

Serverless Invalid variable reference syntax for variable ([\s\S]+?)

I am getting the following error when doing a serverless deploy
Invalid variable reference syntax for variable ([\s\S]+?). You can only reference env vars, options, & files. You can check our docs for more info.
I think it is caused by the following line in my serverless.yml (in the environment block of the provider block):
variableSyntax: "\\${{([\\s\\S]+?)}}"
Why is this invalid? Or is the error actually elsewhere, and if it is, how can I see what line in what file is causing the error?

Building opencv_contrib on Windows: "CMake Error at cmake/OpenCVDetectPython.cmake:78"

It's my fist time using cmake-gui to make the source code of opencv_contrib. And I get an error below. I've searched for it for many times,but do not get any useful help. Even I don't know what the error means. I'm not sure whether merely copying some lines of the error to Google to search is right. I'm sincerely hoping your help.
The error is :
CMake Error at cmake/OpenCVDetectPython.cmake:78 (if):
if given arguments:
"NOT" "optimized" "C:/Program Files/Python35/libs/python35.lib" "debug" "C:/Program Files/Python35/libs/python35_d.lib" "EQUAL" ""
Unknown arguments specified
Call Stack (most recent call first):
cmake/OpenCVDetectPython.cmake:219 (find_python)
CMakeLists.txt:562 (include)
The cmake/OpenCVDetectPython.cmake:73-80 is
if(_found)
set(_version_major_minor "${_version_major}.${_version_minor}")
if(NOT ANDROID AND NOT APPLE_FRAMEWORK)
ocv_check_environment_variables(${library_env} ${include_dir_env})
if(NOT ${${library_env}} EQUAL "")
set(PYTHON_LIBRARY "${${library_env}}")
endif()
note:
I get the source code (cmake/OpenCVDetectPython.cmake:73-80) from my own file. And the error comes when I try to click the generate button.
My environment is :
CPU : Intel Pentium 2020E(64X)
OS : Windows10(64X)
opencv_version : 3.1.0
cmake_version : 3.7.2(win-64X)
python_version : 3.5
VisualStudio_version : 2015
Drives me mad.....
It seems that code in cmake/OpenCVDetectPython.cmake is incorrect. (It isn't corrected in the repo too).
Proper way for check variable's non-emptiness:
if(NOT "${VAR}" STREQUAL "")
In your case original lines in cmake/OpenCVDetectPython.cmake:
if(NOT ${${library_env}} EQUAL "")
set(PYTHON_LIBRARY "${${library_env}}")
should be rewritten as:
if(NOT "${${library_env}}" STREQUAL "")
set(PYTHON_LIBRARY ${${library_env}})
Explanations are below.
The line, to which error message refers
if(NOT ${${library_env}} EQUAL "")
is a part of function's definition find_python(), and library_env is the parameter of this function.
The function is called twice: one for Python2 and one for Python3. According to error message, it is second call which fails, and it passes PYTHON3_LIBRARY as library_env argument.
So errorneous line can be read as:
if(NOT ${PYTHON3_LIBRARY} EQUAL "")
It tries to check, whether variable is not empty ... but does this wrong:
If the variable is actually empty, CMake completely omits its dereference, so the line would be read as
if(NOT EQUAL "")
which is incorrect call to if() command.
In you case, content of the variable PYTHON3_LIBRARY is a list:
optimized "C:/Program Files/Python35/libs/python35.lib" debug "C:/Program Files/Python35/libs/python35_d.lib"
It is valid value for a library, as long as it linked using target_link_libraries command.
But again, in case of list, the if() line becomes incorrect. That is why you get the error message.
Finally, EQUAL compares integers, but strings are compared with STREQUAL.
Both 1 and 2 problems can be fixed by adding qoutes around variable's dereference.
As for assignment
set(PYTHON_LIBRARY "${${library_env}}")
it incorrectly process list variables, which is exactly you case. List variables should be referenced without quotes around them:
set(A_list ${B_list})

Getting errors while converting from Clipper using Harbour

I have created a test project in clipper.
Here is the code for test.prg
store space(1) to mT
# 10,10 say "hellow Time :" get mT pict "!"
read
Here is the generated hbp file code:
-3rd=hbide_version=1.0
-3rd=hbide_type=Executable
-3rd=hbide_title=test
-3rd=hbide_location=d:\hcjs\
-3rd=hbide_workingfolder=
-3rd=hbide_destinationfolder=
-3rd=hbide_output=test
-3rd=hbide_launchparams=
-3rd=hbide_launchprogram=
-3rd=hbide_backupfolder=
-3rd=hbide_xhb=NO
-3rd=hbide_xpp=NO
-3rd=hbide_clp=YES
-inc
-mt
-w3
-es2
-gtwvg
-gui
-lhbwin
-lxhb
test.prg
I have followed the following steps:
1. Open Project
2. I select test.hbp
3. Right-click on Select an environment
4. Select MinGW
5. Again Right Click then Build And Launch
Conversion is not successful. I get some errors. Errors are as follows:
1. Warning: Ambiguous Reference 'mT'
2. Warning: Ambiguous Reference 'GETLIST'
3. Warning: Ambiguous Reference 'GETLIST'
4. Warning: Ambiguous Reference 'GETLIST'
5. Warning: Ambiguous Reference 'GETLIST'
6. Warning: Ambiguous Reference 'GETLIST'
Sorry, cannot launch project because of errors
by the way, it's a warning, not an error. the program should work just fine.
to remove the warning, add these lines to the top of the file :
LOCAL GetList := {}
LOCAL mT
Didn´t you forget to put FUNCTION MAIN() in the first line of your main program? It´s mandatory in [x]Harbour.
Example:
FUNCTION MAIN()
store space(1) to mT
# 10,10 say "hellow Time :" get mT pict "!"
read
If you wanna just make a test like this you don´t need to make a so complicated hbp file to compile it. Just call hbmk2 and the name of the prg file like that:
HBMK2 HELLO.PRG

Optional Argument in cmake macro

I want to create a macro whose argument is optional. If not specified, the argument's value should be an empty string. How can I do this?
Any arguments named in your macro definition are required for callers. However, your macro can still accept optional arguments as long as they aren't explicitly named in the macro definition.
That is, callers are permitted to pass in extra arguments (which were not named in the macro's argument list). Your macro can check for the existence of such extra arguments by checking the ${ARGN} variable.
Beware: ARGN is not a "normal" cmake variable. To use it with the list() command, you'll need to copy it into a normal variable first:
macro (mymacro required_arg1 required_arg2)
# Cannot use ARGN directly with list() command,
# so copy it to a variable first.
set (extra_args ${ARGN})
# Did we get any optional args?
list(LENGTH extra_args extra_count)
if (${extra_count} GREATER 0)
list(GET extra_args 0 optional_arg)
message ("Got an optional arg: ${optional_arg}")
endif ()
endmacro (mymacro)
CMake does not (AFAIK) check the number of variables passed to a macro, so you can just go ahead and declare it as any other macro.
There is also a variable ${ARGN} which expands to a list of all the "remaining" variables passed to a macro, which may be useful.
Update
As stated in Sam's comment, CMake now fails unless all expected (named) arguments are given when calling a macro or function.
This happens by default if the argument isn't specified as CMake doesn't check the number of parameters required for a macro.