SGL-UT / GPSTk

ATTENTION: This repository has been moved and is for archival purposes only. GPSTk toolkit has been renamed to GNSSTK and has been split into two new separate repositories. GNSSTK now only contains libraries while the other repository GNSSTK-APPS contains only applications. The rename and split into libraries and applications started with version v12.0.0 on September 2021. GPSTk --> GNSSTK at https://gitlab.com/sgl-ut/gnsstk --> GNSSTK-APPS at https://gitlab.com/sgl-ut/gnsstk-apps
Other
339 stars 182 forks source link

compilation error on ubuntu #73

Closed anton-sip closed 3 years ago

anton-sip commented 3 years ago

Hello, I try run compilation and get the error. (gpstk version 2.12 worked correctly on my old computer).

CMakeOutput.log build.log Снимок экрана от 2020-11-10 22-03-19

ajkuck commented 3 years ago

This looks like a bug accidentally introduced in our cmake script. It currently doesn't handle specifying the python version in the python executable name. (e.g. It will take -P /usr/bin/python but not -P /usr/bin/python3)

We've got a code push coming in the next couple weeks that should resolve it.

In the meantime, the quickest work-around for you is likely to modify the swig/PythonSetup.cmake file locally. Replace lines:

    execute_process( COMMAND "${PYTHON_EXECUTABLE}3-config" "--includes" OUTPUT_VARIABLE PYTHON_INCLUDES)
    execute_process( COMMAND "${PYTHON_EXECUTABLE}3-config" "--prefix" OUTPUT_VARIABLE PYTHON_PREFIX)

with:

    execute_process( COMMAND "${PYTHON_EXECUTABLE}-config" "--includes" OUTPUT_VARIABLE PYTHON_INCLUDES)        
    execute_process( COMMAND "${PYTHON_EXECUTABLE}-config" "--prefix" OUTPUT_VARIABLE PYTHON_PREFIX)        
anton-sip commented 3 years ago

thanks for fast answer, but i now get error in next step CMakeOutput.log build.log Снимок экрана от 2020-11-11 22-27-43

make all -j 6 make[2]: No rule to make target '/usr/lib/libpython3.8m.so', needed by 'swig/_gpstk.so'. Stop. make[1]: [CMakeFiles/Makefile2:2479: swig/CMakeFiles/_gpstk.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... make: [Makefile:152: all] Error 2

Error 2 :-( See /home/anton/GPSTk/build/desktop-anton-master/Testing/Temporary/LastTest.log for detailed test log See /home/anton/GPSTk/build/desktop-anton-master/build.log for detailed build log anton@desktop-anton:~/GPSTk$

ajkuck commented 3 years ago

This took some time to pin down. I think you're hitting bug related to using python 3.8. (So far, we've only tested up to python 3.6 ... and not on Ubuntu.)

The script isn't able to determine the directory of the python shared object library and the name of that library no longer contains an "m".

An actual fix is pending, but the work-around should be to manually add the location of that library. Modify the swig/PythonSetup.cmake to make this line:

set(PYTHON_LIBRARIES "${PYTHON_PREFIX}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.so")

look like this:

set(PYTHON_LIBRARIES "/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so")

Note: The actual library location may be different on your system. It looks like the best way to find that file is with the command:

$ ls $(python3.8-config --configdir)/libpython3.8.so
# For me this yields:
/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so
ajkuck commented 3 years ago

Also. I noticed you're using the command sudo ./build.sh -eus -P /usr/bin/python3. Using both -u and -s flags might not work correctly.

I'd suggest one or the other.

mercergeoinfo commented 3 years ago

As of 9th April 2021 the error is back/still there in v.8.0.0 and the suggested workaround doesn't work as the number arguments expected doesn't match if the "3" is removed.

UT-dave commented 3 years ago

Please show your modified command exactly as you executed it. Also, it would be helpful to know your system OS/environment configuration.