Hello,
There is a package called LoopTools, for which I succeeded in building a .so
shared lib locally that I can call in julia.
Now I am trying to build it using BinaryBuilder.jl
with the following code that was modified from the documentation
using BinaryBuilder, Pkg
name = "LoopTools"
version = v"2.15"
# Collection of sources required to complete build
sources = [
ArchiveSource("http://www.feynarts.de/looptools/LoopTools-2.15.tar.gz", "a065ffdc4fe6882aa3bb926134ba8ec875d6c0a633c3d4aa5f70db26542713f2"),
]
# Bash recipe for building across all platforms
script = raw"""
cd ${WORKSPACE}/srcdir/LoopTools-*
./configure
make -j${nproc}
make install
"""
# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
# platforms = expand_gfortran_versions(supported_platforms())
#
platforms = [
Linux(:x86_64, libc=:glibc)
]
# The products that we will ensure are always built
products = [
LibraryProduct("liblooptools", :liblooptools)
]
# Dependencies that must be installed before this package can be built
dependencies = Dependency[
]
# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies)
but did not have luck to succeed…
The configure
step already failed with the message:
[21:37:20] ---> ./configure
[21:37:20] looking for gcc... /opt/bin/cc
[21:37:20] looking for g++... /opt/bin/c++
[21:37:20] looking for fortran... /opt/bin/gfortran
[21:37:20] extracting the Fortran libraries... ok
[21:37:20] does gfortran append underscores... error linking Fortran and C
[21:37:20] ---> ./configure
[21:37:20] Previous command exited with 1
[21:37:21] Child Process exited, exit code 1
A successful ./configure
would give a message like the following:
looking for gcc... /usr/bin/clang
looking for g++... /usr/bin/clang++
looking for fortran... /user/bin/gfortran
extracting the Fortran libraries... ok
does gfortran append underscores... yes
does gfortran support REAL*16... yes
does gfortran need 'external' for U77 routines... no
are we big-endian... no
do we have MathLink... yes
creating makefile
now you must run make
In the debug mode of binarybuilder, by LOGFILE=log.txt
, export log.txt
and then ./configure
, I got the following log:
+ shopt -s nullglob
+ export LC_ALL=C
+ LC_ALL=C
+ CONF_DIR=.
++ uname -s
+ CONF_OS=Linux
++ uname -m
+ CONF_MACH=x86_64
+ CONF_DEFPREFIX=x86_64-Linux
+ CONF_PREFIX=x86_64-Linux
+ CONF_TARGET=
+ CONF_STATIC=
+ CONF_STATIC_EXT=
+ CONF_STATIC_GFORTRAN=
+ CONF_QUAD=
+ CONF_QUADSIZE=16
+ CONF_REAL10=
+ CONF_DEBUG=
+ CONF_BITS=
+ CONF_MCLIBS=
+ CONF_ARCH=
+ CONF_AS=
+ CONF_EXE=
+ CONF_LDFLAGS=
+ case "$CONF_OS" in
+ CONF_MCLIBS=' -lpthread -lrt'
+ test=test19
+ trap 'rm -fr test19* =.' 0 1 2 3 15
+ findprog gcc CC clang gcc
+ echo -n 'looking for gcc... '
+ var=CC
+ set -- cc clang gcc
+ test -n ''
+ for prog in "$@"
++ type -P cc
+ full=/opt/bin/cc
+ echo /opt/bin/cc
+ printf -v CONF_CC %q cc
+ return 0
+ findprog g++ CXX clang++ g++
+ echo -n 'looking for g++... '
+ var=CXX
+ set -- c++ clang++ g++
+ test -n ''
+ for prog in "$@"
++ type -P c++
+ full=/opt/bin/c++
+ echo /opt/bin/c++
+ printf -v CONF_CXX %q c++
+ return 0
+ findprog fortran FC ifort pgf90 xlf gfortran g95 f90
+ echo -n 'looking for fortran... '
+ var=FC
+ set -- gfortran ifort pgf90 xlf gfortran g95 f90
+ test -n ''
+ for prog in "$@"
++ type -P gfortran
+ full=/opt/bin/gfortran
+ echo /opt/bin/gfortran
+ printf -v CONF_FC %q gfortran
+ return 0
+ CONF_DEF=-D
++ ++ sed eval gfortran '/^$/d;s/(.*)//;q'
--version -c
+++ gfortran --version -c
+ set -- GNU Fortran 4.8.5
+ case "$1,$2,$3" in
+ eval setflags FFLAGS '-O3 -ffixed-line-length-none -fno-range-check '
++ setflags FFLAGS -O3 -ffixed-line-length-none -fno-range-check
++ rhs=
++ printf -v rhs ' %q' -O3 -ffixed-line-length-none -fno-range-check
++ eval 'CONF_FFLAGS="${rhs//\\,/,}"'
+++ CONF_FFLAGS=' -O3 -ffixed-line-length-none -fno-range-check'
+ echo -n 'extracting the Fortran libraries... '
+ rm -fr
+ tee test19.f
program test
integer i
common /uscore/ i
call exit(i)
end
++ eval gfortran ./configure: line 226: /dev/fd/62: No such file or directory++ eval -O3 -ffixed-line-length-none
gfortran -O3 -fno-range-check -v -ffixed-line-length-none -fno-range-check + eval -o test19 -v -o setflags LDFLAGS test19.f
test19 test19.f' '
++ setflags LDFLAGS
++ rhs=
++ eval 'CONF_LDFLAGS="${rhs//\\,/,}"'
+++ CONF_LDFLAGS=
+ echo ok
++ eval cc --version -c
+ [[ +++ cc --version -c
x86_64-linux-gnu-gcc (GCC) 4.8.5
Copyright (C) 2015 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. =~ gcc ]]
+ CONF_STATIC_GCC=
+ eval setflags CFLAGS '-O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall '
++ setflags CFLAGS -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall
++ rhs=
++ printf -v rhs ' %q' -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall
++ eval 'CONF_CFLAGS="${rhs//\\,/,}"'
+++ CONF_CFLAGS=' -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall'
+ eval setflags CXXFLAGS '-O3 -g -fomit-frame-pointer -ffast-math -Wall '
++ setflags CXXFLAGS -O3 -g -fomit-frame-pointer -ffast-math -Wall
++ rhs=
++ printf -v rhs ' %q' -O3 -g -fomit-frame-pointer -ffast-math -Wall
++ eval 'CONF_CXXFLAGS="${rhs//\\,/,}"'
+++ CONF_CXXFLAGS=' -O3 -g -fomit-frame-pointer -ffast-math -Wall'
+ echo -n 'does gfortran append underscores... '
+ tee test19-c.c
int uscore_ = 95;
int uscore = 59;
+ for CONF_BITS in ${CONF_BITS:--m64 -m32} ""
+ eval cc -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall -m64 -c test19-c.c
++ cc -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall -m64 -c test19-c.c
You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations
Please repent.
+ continue
+ for CONF_BITS in ${CONF_BITS:--m64 -m32} ""
+ eval cc -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall -m32 -c test19-c.c
++ cc -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall -m32 -c test19-c.c
You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations
Please repent.
+ continue
+ for CONF_BITS in ${CONF_BITS:--m64 -m32} ""
+ eval cc -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall -c test19-c.c
++ cc -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall -c test19-c.c
You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations
Please repent.
+ continue
+ ./test19
./configure: line 258: ./test19: No such file or directory
+ case $? in
+ echo 'error linking Fortran and C'
+ exit 1
+ rm -fr test19-c.c test19.f =.
It is far beyond my knowledge to make it work, and I would like to ask for your kind help here. Thank you in advance.