unrecognized command line option ‘-fopenmp=libomp’ [solved (kind-of)]

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
iplayfast
Posts: 256
Joined: Sat Sep 07, 2019 6:55 am

unrecognized command line option ‘-fopenmp=libomp’ [solved (kind-of)]

Post by iplayfast »

Code: Select all

 76%] Built target Fem_autogen
[ 76%] Building CXX object src/Mod/Fem/App/CMakeFiles/Fem.dir/Fem_autogen/mocs_compilation.cpp.o
c++: error: unrecognized command line option ‘-fopenmp=libomp’; did you mean ‘-fopenmp-simd’?
make[2]: *** [src/Mod/Fem/App/CMakeFiles/Fem.dir/build.make:81: src/Mod/Fem/App/CMakeFiles/Fem.dir/Fem_autogen/mocs_compilation.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:5906: src/Mod/Fem/App/CMakeFiles/Fem.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Code: Select all

chris@shop:~$ c++ --version
c++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

chris@shop:~$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

chris@shop:~$ clang --version
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Last edited by iplayfast on Sat Jan 15, 2022 8:09 am, edited 1 time in total.
User avatar
iplayfast
Posts: 256
Joined: Sat Sep 07, 2019 6:55 am

Re: unrecognized command line option ‘-fopenmp=libomp’

Post by iplayfast »

I was able to solve this, by realizing that clang was not the default g++ compiler,
My fix was to rename /usr/bin/g++ to g++1 (a symbolic link to g++-9)
Then create a new symbolic link of clang and g++
Recompiled and all was well.

This was definitely a hack and not the right way to go about it. I still don't know if the problem is in the makefile or linux-mint (ubuntu) configuration.
Post Reply