Opened 10 years ago

Closed 9 years ago

#3332 closed defect (fixed)

ParModelica: libOMOCLRuntime.a not found on Linux

Reported by: Gustaf Thorslund Owned by: Martin Sjölund
Priority: high Milestone:
Component: Build Environment Version: trunk
Keywords: Cc: Mahder Alemseged Gebremedhin

Description

It appears libOMOCLRuntime.a is put in wrong directory during build on GNU/Linux. While other libraries are put in $OPENMODELICAHOME/lib/{i686,x86_64}-linux-gnu/omc/lib during build, libOMOCLRuntime.a is placed in $OPENMODELICAHOME/omc/lib during build. When trying to use ParModelica, this will result in failures like:

$ omc oclTest.mos
true
true
""
Error processing file: oclTest.mos
Error: Error building simulator. Build log: g++ -I"/home/gustaf/src/OpenModelica/build/include/omc/c"   -fPIC -O0 -falign-functions -march=native   -c -o oclTest_test.o oclTest_test.c
g++ -I"/home/gustaf/src/OpenModelica/build/include/omc/c"   -fPIC -O0 -falign-functions -march=native   -c -o oclTest_test_records.o oclTest_test_records.c
gcc -shared -o oclTest_test.so oclTest_test.o oclTest_test_records.o  -I"/home/gustaf/src/OpenModelica/build/include/omc/c"   -fPIC -O0 -falign-functions -march=native   -L"/home/gustaf/src/OpenModelica/build/lib/i686-linux-gnu/omc" -Wl,-rpath,'/home/gustaf/src/OpenModelica/build/lib/i686-linux-gnu/omc' -lOMOCLRuntime -lOpenCL   -lOpenModelicaRuntimeC -llapack -lblas -lm -lpthread -rdynamic -lm
/usr/bin/ld: cannot find -lOMOCLRuntime
collect2: error: ld returned 1 exit status
oclTest_test.makefile:18: recipe for target 'oclTest_test' failed
make: *** [oclTest_test] Error 1

# Error encountered! Exiting...
# Please check the error message and the flags.

Execution failed!

A workaround is to add a symlink.

Change History (5)

comment:1 by Martin Sjölund, 10 years ago

Owner: changed from somebody to Martin Sjölund
Status: newaccepted

comment:2 by Martin Sjölund, 10 years ago

Milestone: Future
Resolution: fixed
Status: acceptedclosed

comment:3 by Gustaf Thorslund, 10 years ago

Resolution: fixed
Status: closedreopened

I'm afraid the fix didn't fix the problem.

$ grep OMOCLRuntime make.log 
cp -rp libOMOCLRuntime.a /home/gusth/src/OpenModelica/build/lib/omc/

The culprit appears to be:

 $ grep -R OPENMODELICA_LIB OMCompiler/SimulationRuntime/ParModelica/
OMCompiler/SimulationRuntime/ParModelica/explicit/openclrt/Makefile.common:OPENMODELICA_LIB=$(TOP_BUILDDIR)/lib/omc/

Maybe a similar fix need to be applied there?

comment:5 by Mahder Alemseged Gebremedhin, 9 years ago

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.