Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

clang error linker command fail

clang error linker command fail

simulating a simple model

Code:


model simple
  Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage1;
  Modelica.Electrical.Analog.Basic.Ground ground1;
  Modelica.Electrical.Analog.Basic.Resistor resistor1 ;
equation
  connect(ground1.p, constantVoltage1.n);
  connect(resistor1.p, constantVoltage1.p);
  connect(ground1.p, resistor1.n) ;
annotation(
    experiment(StartTime = 0, StopTime = 1, Tolerance = 1e-6, Interval = 0.002),
    __OpenModelica_commandLineOptions = "--matchingAlgorithm=PFPlusExt --indexReductionMethod=dynamicStateSelection -d=initialization,NLSanalyticJacobian",
    __OpenModelica_simulationFlags(lv = "LOG_STATS", s = "dassl"));
end simple;

resulting in

clang: error: linker command fail

usinng -v compiler flag i got these information (some of it, can not upload a txt file od screen shot at the moment)

 Spoiler Show Spoiler Hide Spoiler
 
clang -I. -o simple.exe simple.o simple_functions.o simple_records.o simple_01exo.o simple_02nls.o simple_03lsy.o simple_04set.o simple_05evt.o simple_06inz.o simple_07dly.o simple_08bnd.o simple_09alg.o simple_10asr.o simple_11mix.o simple_12jac.o simple_13opt.o simple_14lnz.o simple_15syn.o simple_16dae.o simple_17inl.o simple_18spd.o -I"C:/OpenModelica/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -L"H:/Eigene Dateien"    -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse   -v  -I"C:/OpenModelica/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -L"C:/OpenModelica/lib//omc" -L"C:/OpenModelica/lib" -Wl,--stack,16777216,-rpath,"C:/OpenModelica/lib//omc" -Wl,-rpath,"C:/OpenModelica/lib"  -fopenmp -Wl,-Bstatic -lregex -ltre -lintl -liconv -lexpat -lomcgc -lpthread -loleaut32 -limagehlp -lhdf5 -lz -lszip -Wl,-Bdynamic -Wl,-Bdynamic -lSimulationRuntimeC -Wl,-Bdynamic -Wl,-Bdynamic -lomcgc -lregex -ltre -lintl -liconv -lexpat -static-libgcc -luuid -loleaut32 -lole32 -limagehlp -lws2_32 -llis -lsundials_nvecserial -lsundials_sunmatrixdense -lsundials_sunmatrixsparse -lsundials_sunlinsoldense -lsundials_sunlinsolklu -lsundials_sunlinsollapackdense -lsundials_sunlinsolspbcgs -lsundials_sunlinsolspfgmr -lsundials_sunlinsolspgmr -lsundials_sunlinsolsptfqmr -lsundials_sunnonlinsolnewton -lsundials_cvode -lsundials_cvodes -lsundials_idas -lsundials_kinsol -lumfpack -lklu -lcolamd -lbtf -lamd -lsuitesparseconfig -lipopt -lcoinmumps -lpthread -lm  -lgfortran -lquadmath -lmingw32 -lgcc_eh -lmoldname -lmingwex  -luser32 -lkernel32 -ladvapi32 -lshell32 -lopenblas -lcminpack -Wl,-Bdynamic -lwsock32 -lstdc++
clang version 11.0.0 (https://github.com/msys2/MINGW-packages c0083b9edc111315c868f9c53dd60aaa78d1669b)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:\OPENMO~1\tools\msys\mingw64\bin
"C:\\OPENMO~1\\tools\\msys\\mingw64\\bin\\ld" -m i386pep -Bdynamic -o simple.exe "C:\\OPENMO~1\\tools\\msys\\mingw64\\x86_64-w64-mingw32\\lib\\crt2.o" "C:\\OPENMO~1\\tools\\msys\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\5.3.0\\crtbegin.o" "-LH:/Eigene Dateien" -LC:/OpenModelica/lib//omc -LC:/OpenModelica/lib "-LC:\\OPENMO~1\\tools\\msys\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\5.3.0" "-LC:\\OPENMO~1\\tools\\msys\\mingw64\\x86_64-w64-mingw32\\lib" "-LC:\\OPENMO~1\\tools\\msys\\mingw64\\lib" "-LC:\\OPENMO~1\\tools\\msys\\mingw64\\x86_64-w64-mingw32/sys-root/mingw/lib" simple.o simple_functions.o simple_records.o simple_01exo.o simple_02nls.o simple_03lsy.o simple_04set.o simple_05evt.o simple_06inz.o simple_07dly.o simple_08bnd.o simple_09alg.o simple_10asr.o simple_11mix.o simple_12jac.o simple_13opt.o simple_14lnz.o simple_15syn.o simple_16dae.o simple_17inl.o simple_18spd.o --stack 16777216 -rpath "C;C:\\OPENMO~1\\tools\\msys\\OpenModelica\\lib\\omc" -rpath C:/OpenModelica/lib -Bstatic -lregex -ltre -lintl -liconv -lexpat -lomcgc -lpthread -loleaut32 -limagehlp -lhdf5 -lz -lszip -Bdynamic -Bdynamic -lSimulationRuntimeC -Bdynamic -Bdynamic -lomcgc -lregex -ltre -lintl -liconv -lexpat -luuid -loleaut32 -lole32 -limagehlp -lws2_32 -llis -lsundials_nvecserial -lsundials_sunmatrixdense -lsundials_sunmatrixsparse -lsundials_sunlinsoldense -lsundials_sunlinsolklu -lsundials_sunlinsollapackdense -lsundials_sunlinsolspbcgs -lsundials_sunlinsolspfgmr -lsundials_sunlinsolspgmr -lsundials_sunlinsolsptfqmr -lsundials_sunnonlinsolnewton -lsundials_cvode -lsundials_cvodes -lsundials_idas -lsundials_kinsol -lumfpack -lklu -lcolamd -lbtf -lamd -lsuitesparseconfig -lipopt -lcoinmumps -lpthread -lm -lgfortran -lquadmath -lmingw32 -lgcc_eh -lmoldname -lmingwex -luser32 -lkernel32 -ladvapi32 -lshell32 -lopenblas -lcminpack -Bdynamic -lwsock32 -lstdc++ -lomp -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 "C:\\OPENMO~1\\tools\\msys\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\5.3.0\\crtend.o"
C:\OPENMO~1\tools\msys\mingw64\bin\ld: C:/OpenModelica/lib//omc/libSimulationRuntimeC.a(simulation_runtime.o):simulation_runtime:(.text+0x5327): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
C:\OPENMO~1\tools\msys\mingw64\bin\ld: C:/OpenModelica/lib//omc/libSimulationRuntimeC.a(simulation_runtime.o):simulation_runtime:(.text+0x5370): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
C:\OPENMO~1\tools\msys\mingw64\bin\ld: C:/OpenModelica/lib//omc/libSimulationRuntimeC.a(simulation_runtime.o):simulation_runtime:(.text+0x65c6): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
C:\OPENMO~1\tools\msys\mingw64\bin\ld: C:/OpenModelica/lib//omc/libSimulationRuntimeC.a(dataReconciliation.o):dataReconciliation:(.text+0x6b): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
C:\OPENMO~1\tools\msys\mingw64\bin\ld: C:/OpenModelica/lib//omc/libSimulationRuntimeC.a(dataReconciliation.o):dataReconciliation:(.text+0xd6f2): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
C:\OPENMO~1\tools\msys\mingw64\bin\ld: C:/OpenModelica/lib//omc/libSimulationRuntimeC.a(dataReconciliation.o):dataReconciliation:(.text+0xd93d): more undefined references to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()' follow
C:\OPENMO~1\tools\msys\mingw64\bin\ld: C:/OpenModelica/lib//omc/libcoinmumps.a(dmumps_part5.o):dmumps_part5.Fcurrent/sad.text+0x15522): undefined reference to `_gfortran_os_error_at'
C:\OPENMO~1\tools\msys\mingw64\bin\ld: C:/OpenModelica/lib//omc/libcoinmumps.a(dmumps_part5.o):dmumps_part5.Fcurrent/sad.text+0x1567e): undefined reference to `_gfortran_os_error_at'
C:\OPENMO~1\tools\msys\mingw64\bin\ld: C:/OpenModelica/lib//omc/libcoinmumps.a(dmumps_part5.o):dmumps_part5.Fcurrent/sad.text+0x16729): undefined reference to `_gfortran_os_error_at'
C:\OPENMO~1\tools\msys\mingw64\bin\ld: C:/OpenModelica/lib//omc/libcoinmumps.a(dmumps_part5.o):dmumps_part5.Fcurrent/sad.text+0x1682a): undefined reference to `_gfortran_os_error_at'
C:\OPENMO~1\tools\msys\mingw64\bin\ld: C:/OpenModelica/lib//omc/libcoinmumps.a(dmumps_part5.o):dmumps_part5.Fcurrent/sad.text+0x24847): undefined reference to `_gfortran_os_error_at'
C:\OPENMO~1\tools\msys\mingw64\bin\ld: C:/OpenModelica/lib//omc/libcoinmumps.a(dmumps_part5.o):dmumps_part5.Fcurrent/sad.text+0x33367): more undefined references to `_gfortran_os_error_at' follow
clang: error: linker command failed with exit code 1 (use -v to see invocation)
mingw32-make: *** [simple.makefile:37: omc_main_target] Error 1
mingw32-make: Leaving directory 'C:/Users/xxx/AppData/Local/Temp/31/OPENMO~1/OMEdit/simple'
Compilation process failed. Exited with code 0x00000002.
can somebody enlighten me, what was going on?

Edited by: Arinomo23 - Jul-02-21 11:55:59

Re: clang error linker command fail

What version of OpenModelica do you have?

You seem to have a combination of some old OpenModelica and new OpenModelica version as I see there directory: "%OPENMODELICAHOME%\\tools\\msys\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\5.3.0"
which should NOT be there if you also have clang, it should be "%OPENMODELICAHOME%\\tools\\msys\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\10.2.0"!



Re: clang error linker command fail

Hi Adrian, thanks for the reply

just updated to v1.18.0-dev-285-gc5eac8a7bd (64-bit) from (i think) v.1.13. Is there a workaround to fixed it or should it be a re-install ?

Edit: found the dir './5.3.0' should i just delete it?

Edited by: Arinomo23 - Jul-02-21 13:10:09

Re: clang error linker command fail

I suggest you restart (to kill any process that might hold dlls or exe hostage) then uninstall OpenModelica then delete the directory, then install it again.

Re: clang error linker command fail

adrpo wrote:


I suggest you restart (to kill any process that might hold dlls or exe hostage) then uninstall OpenModelica then delete the directory, then install it again.

OK, i will give it a try.

Thanks Adrian!

Re: clang error linker command fail

it works now. thanks!

There are 0 guests and 0 other users also viewing this topic
You are here: