Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing target Threads::Threads #9202

Closed
michele-segata opened this issue Sep 21, 2021 · 3 comments
Closed

Missing target Threads::Threads #9202

michele-segata opened this issue Sep 21, 2021 · 3 comments
Assignees

Comments

@michele-segata
Copy link
Contributor

Hi all,

I was trying to compile sumo on an HPC where I don't have administrative rights, which means I cannot simply install system-wide libraries, but I need to install them locally. I thus only installed XercesC as all the others are not required (GUI for example is useless, we are running simulations on a remote server). While configuring the project, however, I am getting the following errors in the output:

-- CMAKE_BINARY_DIR: /home/user/src/sumo/build/cmake-build
-- CMAKE_SOURCE_DIR: /home/user-- CMAKE_BINARY_DIR: /home/user/src/sumo/build/cmake-build
-- CMAKE_SOURCE_DIR: /home/user/src/sumo
-- 
-- Platform: 
--     Host: Linux-3.10.0-957.21.2.el7.x86_64 x86_64
--     Target: Linux-3.10.0-957.21.2.el7.x86_64 x86_64
--     CMake: 3.20.5
--     CMake generator: Unix Makefiles
--     CMake build tool: /usr/bin/gmake
--     Compiler: GNU 9.1.0
-- 
-- Found Python: /usr/bin/python
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) 
-- Could NOT find Proj
-- Found Fox: -L/home/user/.local/lib -lFOX-1.6 -lX11 -lXext -lfreetype -lfontconfig -lXft -lXrender -ldl -lpthread -lrt -ljpeg -lpng -lz -lbz2
-- Could NOT find SWIG: Found unsuitable version "2.0.10", but required is at least "3.0" (found /usr/bin/swig, )
-- Could NOT find GDAL (missing: GDAL_LIBRARY GDAL_INCLUDE_DIR) (found version "GDAL_VERSION-NOTFOUND")
-- Could NOT find suitable FFmpeg.
-- Could NOT find osgGA (missing: OSGGA_LIBRARY OSGGA_INCLUDE_DIR) 
-- Could NOT find osgViewer (missing: OSGVIEWER_LIBRARY OSGVIEWER_INCLUDE_DIR) 
-- Could NOT find osgUtil (missing: OSGUTIL_LIBRARY OSGUTIL_INCLUDE_DIR) 
-- Could NOT find osgDB (missing: OSGDB_LIBRARY OSGDB_INCLUDE_DIR) 
-- Could NOT find osgText (missing: OSGTEXT_LIBRARY OSGTEXT_INCLUDE_DIR) 
-- Could NOT find osg (missing: OSG_LIBRARY OSG_INCLUDE_DIR) 
-- Could NOT find OpenThreads (missing: OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR) 
-- Could NOT find OpenSceneGraph (missing: OPENSCENEGRAPH_LIBRARIES OPENSCENEGRAPH_INCLUDE_DIR) (Required is at least version "3.4.0")
-- Could NOT find GL2PS (missing: GL2PS_LIBRARY GL2PS_INCLUDE_DIR) 
-- Could NOT find Eigen3 (missing: EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) (Required is at least version "3.2")
-- Could NOT find Java (missing: Java_JAVAC_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVADOC_EXECUTABLE Java_JAVAH_EXECUTABLE Development) (found version "1.8.0.212")
-- Enabled features: Linux-3.10.0-957.21.2.el7.x86_64 x86_64 GNU 9.1.0 Release GUI
-- Configuring done
CMake Error at src/CMakeLists.txt:84 (add_executable):
  Target "od2trips" links to target "Threads::Threads" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at src/CMakeLists.txt:56 (add_executable):
  Target "sumo-gui" links to target "Threads::Threads" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at src/CMakeLists.txt:78 (add_executable):
  Target "netconvert" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/CMakeLists.txt:46 (add_executable):
  Target "sumo" links to target "Threads::Threads" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at src/activitygen/CMakeLists.txt:16 (add_executable):
  Target "activitygen" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/dfrouter/CMakeLists.txt:24 (add_executable):
  Target "dfrouter" links to target "Threads::Threads" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at src/duarouter/CMakeLists.txt:9 (add_executable):
  Target "duarouter" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/jtrrouter/CMakeLists.txt:15 (add_executable):
  Target "jtrrouter" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/libsumo/CMakeLists.txt:71 (add_library):
  Target "libsumocpp" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/marouter/CMakeLists.txt:15 (add_executable):
  Target "marouter" links to target "Threads::Threads" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at src/netgen/CMakeLists.txt:15 (add_executable):
  Target "netgenerate" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/polyconvert/CMakeLists.txt:24 (add_executable):
  Target "polyconvert" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/tools/CMakeLists.txt:7 (add_executable):
  Target "emissionsDrivingCycle" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at src/tools/CMakeLists.txt:13 (add_executable):
  Target "emissionsMap" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/traci_testclient/CMakeLists.txt:20 (add_executable):
  Target "testlibsumostatic" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at src/netedit/CMakeLists.txt:34 (add_executable):
  Target "netedit" links to target "Threads::Threads" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

I thought that given that the issue refers to "Threads" it had something to do with FOX, but even installing it and re-running cmake didn't fix the issue. Makefile is anyway generated, but when compiling it fails at linking:

[100%] Building CXX object src/CMakeFiles/sumo.dir/sumo_main.cpp.o
[100%] Linking CXX executable ../../../bin/sumo
/usr/bin/ld: cannot find -lThreads::Threads
collect2: error: ld returned 1 exit status

I get the same problem both with SUMO 1.9.0 and 1.10.0.

@behrisch
Copy link
Contributor

You should probably try to enforce pthreads. Can you have a look at the solution provided here: alicevision/geogram#2 ?

@michele-segata
Copy link
Contributor Author

Hi Michael,

we tried that but it didn't work. After trying a little bit, we found the following procedure working. Maybe it is of interest for people running simulations on computational machines where they have no admin rights and no need for the GUI.

XercesC

Downloading

cd $HOME/src
wget https://dlcdn.apache.org/xerces/c/3/sources/xerces-c-3.2.3.tar.gz
tar -xf xerces-c-3.2.3.tar.gz

Building and installing it locally

cd $HOME/src/xerces-c-3.2.3
mkdir build
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=$HOME/ ..
cmake --build .
make install

SUMO

Downloading

cd $HOME/src
git clone --recursive https://github.com/eclipse/sumo
cd sumo
git fetch origin refs/replace/*:refs/replace/*

Building using locally installed XercesC library

cd $HOME/src/sumo
export SUMO_HOME=$(pwd)
mkdir build/cmake-build
cd build/cmake-build
cmake -DCMAKE_PREFIX_PATH=$HOME -D CHECK_OPTIONAL_LIBS=OFF -D PROJ_LIBRARY= -D FOX_CONFIG= ../..
make -j$(nproc)

@behrisch
Copy link
Contributor

behrisch commented Oct 8, 2021

Great that you could make it work. Another option might be to use the python package eclipse-sumo, see https://sumo.dlr.de/docs/Downloads.php#python_packages_virtual_environments.

@behrisch behrisch closed this as completed Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants