Compiling on Mac failing

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Brutha
Posts: 221
Joined: Mon May 04, 2015 1:50 pm

Compiling on Mac failing

Post by Brutha »

Hi All,

I'm trying to compile the most recent master of Freecad on Mac using the instructions Vectronic kindly provided here: https://vectronic.io/posts/building-fre ... ing-conda/.

It was previously working; I had a 0.19 version working nicely. But since I upgraded to latest version of Mojave, there are some glitches (missing workbench selection bar, no grid). So, I thought I would try running the build again to see if that helped.

Basically, I run from the "conda build ./recipe -m ./.ci_support/osx_python3.7.yaml" step; it pulls in updates from https://github.com/FreeCAD/FreeCAD, but fails when it starts to build.

Here's the info in the console at the point it stops:

Code: Select all

-- Check for working C compiler: $BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang -- broken
CMake Error at /Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_build_env/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_build_env/bin/x86_64-apple-darwin13.4.0-clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/brutha/miniconda3/conda-bld/freecad_1565776784984/work/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_build_env/bin/ninja cmTC_8f50c && [1/2] Building C object CMakeFiles/cmTC_8f50c.dir/testCCompiler.c.o
    [2/2] Linking C executable cmTC_8f50c
    FAILED: cmTC_8f50c 
    : && /Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_build_env/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/include -fdebug-prefix-map=/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/work=/usr/local/src/conda/freecad-master -fdebug-prefix-map=/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla=/usr/local/src/conda-prefix  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib -L/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib CMakeFiles/cmTC_8f50c.dir/testCCompiler.c.o  -o cmTC_8f50c   && :
    ld: library not found for -lSystem
    clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:25 (project)


-- Configuring incomplete, errors occurred!
See also "$SRC_DIR/build/CMakeFiles/CMakeOutput.log".
See also "$SRC_DIR/build/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "/Users/brutha/miniconda3/bin/conda-build", line 11, in <module>
    sys.exit(main())
  File "/Users/brutha/miniconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 445, in main
    execute(sys.argv[1:])
  File "/Users/brutha/miniconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 436, in execute
    verify=args.verify, variants=args.variants)
  File "/Users/brutha/miniconda3/lib/python3.7/site-packages/conda_build/api.py", line 209, in build
    notest=notest, need_source_download=need_source_download, variants=variants)
  File "/Users/brutha/miniconda3/lib/python3.7/site-packages/conda_build/build.py", line 2343, in build_tree
    notest=notest,
  File "/Users/brutha/miniconda3/lib/python3.7/site-packages/conda_build/build.py", line 1491, in build
    cwd=src_dir, stats=build_stats)
  File "/Users/brutha/miniconda3/lib/python3.7/site-packages/conda_build/utils.py", line 397, in check_call_env
    return _func_defaulting_env_to_os_environ('call', *popenargs, **kwargs)
  File "/Users/brutha/miniconda3/lib/python3.7/site-packages/conda_build/utils.py", line 377, in _func_defaulting_env_to_os_environ
    raise subprocess.CalledProcessError(proc.returncode, _args)
subprocess.CalledProcessError: Command '['/bin/bash', '-e', '/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/work/conda_build.sh']' returned non-zero exit status 1.
Here's the CMakeError.log mentioned:

Code: Select all

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_build_env/bin/x86_64-apple-darwin13.4.0-clang 
Build flags: -march=core2;-mtune=haswell;-mssse3;-ftree-vectorize;-fPIC;-fPIE;-fstack-protector-strong;-O2;-pipe;-I/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/include;-fdebug-prefix-map=/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/work=/usr/local/src/conda/freecad-master;-fdebug-prefix-map=/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla=/usr/local/src/conda-prefix
Id flags:  

The output was:
1
ld: library not found for -lSystem
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_build_env/bin/x86_64-apple-darwin13.4.0-clang++ 
Build flags: -march=core2;-mtune=haswell;-mssse3;-ftree-vectorize;-fPIC;-fPIE;-fstack-protector-strong;-O2;-pipe;-stdlib=libc++;-fvisibility-inlines-hidden;-std=c++14;-fmessage-length=0;-I/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/include;-fdebug-prefix-map=/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/work=/usr/local/src/conda/freecad-master;-fdebug-prefix-map=/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla=/usr/local/src/conda-prefix
Id flags:  

The output was:
1
ld: library not found for -lSystem
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)


Determining if the C compiler works failed with the following output:
Change Dir: /Users/brutha/miniconda3/conda-bld/freecad_1565776784984/work/build/CMakeFiles/CMakeTmp

Run Build Command(s):/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_build_env/bin/ninja cmTC_8f50c && [1/2] Building C object CMakeFiles/cmTC_8f50c.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_8f50c
FAILED: cmTC_8f50c 
: && /Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_build_env/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/include -fdebug-prefix-map=/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/work=/usr/local/src/conda/freecad-master -fdebug-prefix-map=/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla=/usr/local/src/conda-prefix  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib -L/Users/brutha/miniconda3/conda-bld/freecad_1565776784984/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib CMakeFiles/cmTC_8f50c.dir/testCCompiler.c.o  -o cmTC_8f50c   && :
ld: library not found for -lSystem
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Can anyone suggest a way forward? I really don't have any idea what to try!

Thanks,

Brutha
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Compiling on Mac failing

Post by Kunda1 »

Please cross-post to the conda thread for assistance
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
rawafn
Posts: 4
Joined: Sun Dec 15, 2019 5:24 pm

Re: Compiling on Mac failing

Post by rawafn »

Hello,

I think I have the same issue. I get the same failure.
I trying to compile Freecad the first time, so I'm not sure, what is the problem.
Here some information.
Build Freecad Version 0.18.4
OS X: Catalina 10.15.2
Python Version 3.7.3
Conda latest version.
I have following error message, before it will stop the build of Freecad:

Code: Select all

ln: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/MacOSX10.12.sdk: File exists
Traceback (most recent call last):
  File "/Users/xxxxx/miniconda3/envs/freecad_0_18_4/bin/conda-build", line 11, in <module>
    sys.exit(main())
  File "/Users/xxxxx/miniconda3/envs/freecad_0_18_4/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 469, in main
    execute(sys.argv[1:])
  File "/Users/xxxxx/miniconda3/envs/freecad_0_18_4/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 460, in execute
    verify=args.verify, variants=args.variants)
  File "/Users/xxxxx/miniconda3/envs/freecad_0_18_4/lib/python3.7/site-packages/conda_build/api.py", line 209, in build
    notest=notest, need_source_download=need_source_download, variants=variants)
  File "/Users/xxxxx/miniconda3/envs/freecad_0_18_4/lib/python3.7/site-packages/conda_build/build.py", line 2344, in build_tree
    notest=notest,
  File "/Users/xxxxx/miniconda3/envs/freecad_0_18_4/lib/python3.7/site-packages/conda_build/build.py", line 1492, in build
    cwd=src_dir, stats=build_stats)
  File "/Users/xxxxx/miniconda3/envs/freecad_0_18_4/lib/python3.7/site-packages/conda_build/utils.py", line 398, in check_call_env
    return _func_defaulting_env_to_os_environ('call', *popenargs, **kwargs)
  File "/Users/xxxxx/miniconda3/envs/freecad_0_18_4/lib/python3.7/site-packages/conda_build/utils.py", line 378, in _func_defaulting_env_to_os_environ
    raise subprocess.CalledProcessError(proc.returncode, _args)
subprocess.CalledProcessError: Command '['/bin/bash', '-o', 'errexit', '/Users/xxxxx/miniconda3/envs/freecad_0_18_4/conda-bld/freecad_1576430372903/work/conda_build.sh']' returned non-zero exit status 1.
If you could forward me the link to the conda thread would also be fine.

Thank you for your support.

Regards

Ralf
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Compiling on Mac failing

Post by vocx »

rawafn wrote: Sun Dec 15, 2019 5:32 pm Hello,

I think I have the same issue. I get the same failure.
I trying to compile Freecad the first time, so I'm not sure, what is the problem.
You seem to have a different problem.

If you see the error message produced by the previous poster it indicates missing libraries. In this case, it shows missing libSystem.so or something like that.

I don't have experience compiling on Mac; I can only recommend to follow Compile_on_MacOS, but this may be outdated. If you are using Conda, make sure you have all dependencies.
Brutha wrote: Wed Aug 14, 2019 10:22 am ld: library not found for -lSystem
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
rawafn
Posts: 4
Joined: Sun Dec 15, 2019 5:24 pm

Re: Compiling on Mac failing

Post by rawafn »

I found the issue.
Always when I would recompile FreeCAD I need to delete the MaxOSX10.12.sdk
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/MacOSX10.12.sdk
Regards

Ralf
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: Compiling on Mac failing

Post by chrisb »

rawafn wrote: Thu Dec 19, 2019 11:28 am I found the issue.
Always when I would recompile FreeCAD I need to delete the MaxOSX10.12.sdk
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/MacOSX10.12.sdk
Good find. Would you mind adding it to the wiki?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply