# third party libs for linking
mpi_libs = ['open-pal', 'open-rte', 'mpi', 'mpi_cxx']
'sqlite3','xslt','xml2','xerces-c','fftw3f_threads','fftw3f', 'fftw3_threads',
'fftw3','lapack','wcs','cfitsio','rpfits','blas'
] + get_grpc_libs() + ['readline', 'gfortran', 'dl'] + mpi_libs + ['python3.6m']
] + get_grpc_libs() + ['readline', 'gfortran', 'dl'] + mpi_libs + [f"python{pyversion}m"]
def get_gfortran_lib_path( ):
proc = Popen([ props['build.compiler.fortran'], "-print-search-dirs"], stdout=PIPE, stderr=PIPE )
out,err = pipe_decode(proc.communicate( ))
sys.exit('failed to find libgfortran')
for line in out.split('\n'):
if line.startswith('libraries: ='):
+ "-D_REENTRANT -I/usr/include/cfitsio -I/usr/include/eigen3 "
+ "-I/opt/casa/03/include -DWITHOUT_DBUS " \
+ "-I/usr/include/libxml2 -I/usr/include -I/usr/include/wcslib "
+ "-fopenmp -I/opt/rh/rh-python36/root/usr/include -Wall " \
+ "--param=ssp-buffer-size=4 -DAIPS_64B -DAIPS_AUTO_STL " \
+ "-DAIPS_DEBUG -DAIPS_HAS_QWT -DAIPS_LINUX " \
+ "-DAIPS_LITTLE_ENDIAN -DAIPS_STDLIB " \
+ "-DCASACORE_NEEDS_RETHROW -DCASA_USECASAPATH -DQWT6 " \
+ "-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE " \
+ "-DNO_CRASH_REPORTER -fno-omit-frame-pointer -DWITHOUT_ACS " \
+ "-DUSE_GRPC -Ibuild/binding.linux-x86_64-3.6/grpc " \
+ "-Ibuild/lib.linux-x86_64-3.6/casatools/__casac__/include "
+ f"-DUSE_GRPC -Ibuild/binding.linux-x86_64-{pyversion}/grpc " \
+ f"-Ibuild/lib.linux-x86_64-{pyversion}/casatools/__casac__/include "
# -shared causes a segfault
+ "-lpython3.6m " + dflags + " "
+ f"-lpython{pyversion}m " + dflags + " "
+ "-o " + exefile + " " + wflags + " "
# ommitting POSTCOMPILE for now
# + '\n\t$(POSTCOMPILE)')
# "\n\n" + test_targ.format(src=f, base=base)
# mk.write("\n" + g_dep_targ.format(base=base))
# mk.write("\n" + g_dep_targ.format(base=base))
write_dependency_tracking()
# extra state for building unit tests
g_build_state['lib-path']['libcasatools'] = libcasatools
g_build_state['grpc'] = { 'include': [ os.path.join('build', distutils_dir_name('lib'), module_name, '__casac__', "include") ],
'cflags': [ '-DUSE_GRPC' ],
'libs': [ '-lgrpc++', '-lgrpc', '-lgpr', '-lprotobuf' ] }
g_build_state['python'] = { 'libs': [ '-lpython3.6m' ],
g_build_state['python'] = { 'libs': [ f"-lpython{pyversion}m" ],
# dump build state for building unit tests
with open( build_config_file, 'w' ) as f:
json.dump( g_build_state, f )
"Successfully generated makefile! Now, run 'make [-j<n>]' "