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

Make run_example failed #19

Closed
micleb opened this issue May 24, 2018 · 8 comments
Closed

Make run_example failed #19

micleb opened this issue May 24, 2018 · 8 comments

Comments

@micleb
Copy link

micleb commented May 24, 2018

Hello,

I successful built Veins, Vanetza, Inet and Artery but I am stuck at : cmake --build build --target run_example

This command always failed with the following output :

user@debian:~/ITS/artery/build$ make run_example
[ 13%] Built target traci
[ 14%] Building Vanetza (external dependency)
-- Boost version: 1.62.0
-- Found the following Boost libraries:
--   date_time
-- Cohda SDK not found (missing:  COHDA_ROOT) 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/ITS/artery/extern/vanetza/build
[ 80%] Built target asn1
[ 81%] Built target common
[ 83%] Built target net
[ 90%] Built target security
[ 92%] Built target dcc
[ 97%] Built target geonet
[ 98%] Built target btp
[ 99%] Built target facilities
[100%] Built target gnss
[100%] Built target proxy_fake_feed
[ 14%] Built target build_vanetza
[ 14%] Building INET (external dependency)
*** COMPILING with:
g++ -c -std=c++11 -O2 -DNDEBUG=1 -MMD -MP -MF .d  -fPIC  -fno-stack-protector -DHAVE_SWAPCONTEXT -DWITH_MPI -DXMLPARSER=libxml -DPREFER_QTENV -DWITH_QTENV -DWITH_TKENV -DWITH_PARSIM -DWITH_NETBUILDER -DWITH_OSG -DWITH_OSGEARTH -Wno-overloaded-virtual -include inet/common/precompiled_release.h  -DINET_EXPORT -I. -I/home/user/ITS/omnetpp-5.1.1/include
*** LINKING with:
g++ -shared -fPIC -o ../out/gcc-release/src/libINET.so -Wl,--no-as-needed -Wl,--whole-archive  -Wl,--no-whole-archive -loppenvir -loppsim -ldl -lstdc++  -lOpenThreads -losg -losgText -losgDB -losgEarth -losgEarthUtil -Wl,-rpath,/home/user/ITS/omnetpp-5.1.1/lib -Wl,-rpath,/lib -Wl,-rpath,.  -Wl,--export-dynamic -L/home/user/ITS/omnetpp-5.1.1/lib
Building...
[ 14%] Built target build_inet
[ 15%] Building Veins (external dependency)
[ 15%] Built target build_veins
[ 63%] Built target core
[ 78%] Built target envmod
[100%] Built target storyboard
OMNeT++ Discrete Event Simulation  (C) 1992-2017 Andras Varga, OpenSim Ltd.
Version: 5.1.1, build: 170508-adbabd0, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer


<!> Error: Attempt to load the oppsim shared library more than once. This usually happens when part of your simulation is using release libraries while other parts are using the debug version. Make sure to rebuild all parts of your model in either release or debug mode!
Segmentation fault
scenarios/artery/CMakeFiles/run_example.dir/build.make:57 : la recette pour la cible « scenarios/artery/CMakeFiles/run_example » a échouée
make[3]: *** [scenarios/artery/CMakeFiles/run_example] Erreur 139
CMakeFiles/Makefile2:679 : la recette pour la cible « scenarios/artery/CMakeFiles/run_example.dir/all » a échouée
make[2]: *** [scenarios/artery/CMakeFiles/run_example.dir/all] Erreur 2
CMakeFiles/Makefile2:686 : la recette pour la cible « scenarios/artery/CMakeFiles/run_example.dir/rule » a échouée
make[1]: *** [scenarios/artery/CMakeFiles/run_example.dir/rule] Erreur 2
Makefile:287 : la recette pour la cible « run_example » a échouée
make: *** [run_example] Erreur 2

The recipe for the target " run_example" failed

And I do not understand this warning message :

Attempt to load the oppsim shared library more than once. This usually happens when part of your simulation is using release libraries while other parts are using the debug version. Make sure to rebuild all parts of your model in either release or debug mode!

I just followed the tutorial step by step, that's all. What am I supposed to do/change ?

Could you help me ?

Thank you

@riebl
Copy link
Owner

riebl commented May 24, 2018

I can see from your console dump that INET is compiled in release mode (as out/gcc-release/src/libINET.so library). As the output by opp_run tells you one should not mix OMNeT++ libraries (such as Veins, INET and Artery) when they are not all built in the same mode, i.e. release or debug.
For example, you can force INET to be built in debug mode by calling make MODE=debug in extern/inet.

@micleb
Copy link
Author

micleb commented May 24, 2018

I executed make MODE=debug in extern/inet. The compilation was successful.

But cmake --build build --target run_example is still not working (same output)

[...]

[ 14%] Building INET (external dependency)
*** COMPILING with:
g++ -c -std=c++11 -O2 -DNDEBUG=1 -MMD -MP -MF .d  -fPIC  -fno-stack-protector -DHAVE_SWAPCONTEXT -DWITH_MPI -DXMLPARSER=libxml -DPREFER_QTENV -DWITH_QTENV -DWITH_TKENV -DWITH_PARSIM -DWITH_NETBUILDER -DWITH_OSG -DWITH_OSGEARTH -Wno-overloaded-virtual -include inet/common/precompiled_release.h  -DINET_EXPORT -I. -I/home/user/ITS/omnetpp-5.1.1/include
*** LINKING with:
g++ -shared -fPIC -o ../out/gcc-release/src/libINET.so -Wl,--no-as-needed -Wl,--whole-archive  -Wl,--no-whole-archive -loppenvir -loppsim -ldl -lstdc++  -lOpenThreads -losg -losgText -losgDB -losgEarth -losgEarthUtil -Wl,-rpath,/home/user/ITS/omnetpp-5.1.1/lib -Wl,-rpath,/lib -Wl,-rpath,.  -Wl,--export-dynamic -L/home/user/ITS/omnetpp-5.1.1/lib

[...]

@micleb
Copy link
Author

micleb commented May 25, 2018

@riebl Any idea how to fix that ?

Like I said in my previous post, I tried make MODE=debug in the inet folder (it worked) but when I try to compile run_example the default mode is "release"

I also tried make run_example mode=debug in the build directory, but the error is still there

@riebl
Copy link
Owner

riebl commented May 25, 2018

@micleb I still don't know why this problem occurs on your system. You can try to build Veins in release mode explicitly as well, similar to INET.
I have the feeling that something with the generated veins-targets.cmake and INET-targets.cmake files in your build directory is odd, e.g. one of them is missing the release configuration und thus falling back to the debug build.

@riebl
Copy link
Owner

riebl commented May 29, 2018

@micleb Did you manage to get Artery running in the meantime?

@dnguyenkth
Copy link

Hi, I also got the same problem a while ago. I got the error on 9ec5eba and don't know if the error persists after that. However, then i tried cloning down the 655d46a commit (from march) and I didn't get the same error. So it seems to be caused by some CMake change after that. Hope it helps in discovering the issue.

@riebl
Copy link
Owner

riebl commented Jun 9, 2018

@dnguyenkth Thanks for your additional insights. You may try to remove all *-targets.cmake files from your build directory when this problem occurs.
It seems that those files, which are generated by Artery's opp_cmake, are not updated when dependencies such as Veins or INET have been built with another mode option. Removing them forces CMake to run opp_cmake again.

@dnguyenkth
Copy link

I get it to build without any problem on the latest commit 577e2bd, so I guess this is solved now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants