cctbx_project icon indicating copy to clipboard operation
cctbx_project copied to clipboard

setting compiler toolchain for scons/cctbx

Open rimmartin opened this issue 5 years ago • 5 comments

Hi,

how to set the compiler toolchain? I'm following https://cctbx.github.io/installation.html to build on a mac 10.14.2. It fails on building openssl:

  getting package openssl-1.0.2r.tar.gz...
    downloading from https://gitcdn.link/repo/dials/dependencies/master/ : 5223 kB

  installing openssl-1.0.2r.tar.gz...
Traceback (most recent call last):
  File "modules/cctbx_project/libtbx/auto_build/install_base_packages.py", line 1674, in <module>
    installer(args=sys.argv, log=sys.stdout)
  File "modules/cctbx_project/libtbx/auto_build/install_base_packages.py", line 250, in __init__
    self.build_dependencies(packages=packages)
  File "modules/cctbx_project/libtbx/auto_build/install_base_packages.py", line 774, in build_dependencies
    getattr(self, 'build_%s'%i)()
  File "modules/cctbx_project/libtbx/auto_build/install_base_packages.py", line 1236, in build_openssl
    log=pkg_log, limit_nproc=1) # openssl is not parallel buildable
  File "modules/cctbx_project/libtbx/auto_build/install_base_packages.py", line 572, in configure_and_build
    self.call("make -j %d %s" % (nproc, " ".join(list(make_args))), log=log)
  File "modules/cctbx_project/libtbx/auto_build/install_base_packages.py", line 353, in call
    return call(args, log=log, verbose=self.verbose, **kwargs)
  File "/private/var/lib/jenkins-developer/workspace/cctbx-darwin/cctbx/modules/cctbx_project/libtbx/auto_build/installer_utils.py", line 53, in call
    raise RuntimeError("Call to '%s' failed with exit code %d" % (args, rc))
RuntimeError: Call to 'make -j 1 ' failed with exit code 2
===== Running in modules: extracting files from clipper.gz

with g++ --version g++ (GCC) 7.4.0 but I don't no if scons is doing it's own choice of compiler toolchain

rimmartin avatar Apr 12 '19 13:04 rimmartin

no idea about toolchain, but I would advise running bootstrap with --verbose as this will give you the output, which may be more useful than "exit code 2"

Anthchirp avatar Apr 12 '19 13:04 Anthchirp

that tells me the issue:

 /usr/bin/perl ../util/mkbuildinf.pl "/opt/gcc/current/bin/gcc -I. -I.. -I../include  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -fPIC -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM" "darwin64-x86_64-cc" >buildinf.h
: /opt/gcc/current/bin/gcc -I. -I.. -I../include  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -fPIC -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM   -stdlib=libc++ -mmacosx-version-min=10.7  -c -o cryptlib.o cryptlib.c
: gcc: error: unrecognized command line option '-stdlib=libc++'

rimmartin avatar Apr 12 '19 15:04 rimmartin

in the : Configured for darwin64-x86_64-cc. : making all in crypto... step

rimmartin avatar Apr 12 '19 15:04 rimmartin

I'm not sure how well we support GCC on macOS since Xcode moved from GCC to clang. Do you need to compile CCTBX from source? Would a binary installation from http://cci.lbl.gov/cctbx_build/ work?

If you really need to build from source, you should fork this repository and I can help sort out the flags. And depending on what you're using CCTBX for, you might not need all the dependencies, which is where this is failing right now. The main CCTBX source does build with GCC 7.3.0 on linux, so I'm assuming it should build on macOS.

bkpoon avatar Apr 16 '19 04:04 bkpoon

Hi,

Thank you. At this time I have no choice but gcc at work. At work they are set to gcc 6.3 and it builds on CentOS 7. I'll fork and look at these flags and may have a question. We'll see.

rimmartin avatar Apr 18 '19 13:04 rimmartin