makefilesconsubuntu-22.04class-constructors

scons: *** Two environments with different actions were specified for the same target: sfpseudodepth


I try to install Madagascar on Ubuntu22.04. My error came after running make install, the error is: make: *** [Makefile:7: install] Error 2

I have just used Linux, I tried to find a solution to this problem, but I still don't understand what went wrong, so please help me.

This is the contents of my Sconstruct file:

import sys, os
sys.path.append('../../framework')
import bldutil

progs = '''
integral1 pseudodepth
'''

mpi_progs = '''
mpirtmiso
'''

place = ''

try:  # distributed version
    Import('env root pkgdir bindir')
    env = env.Clone()
except: # local version
    env = bldutil.Debug()
    root = None
    SConscript('../../api/c/SConstruct')

src = Glob('[a-z]*.c')

env.Prepend(CPPPATH=['../../include'],
            LIBPATH=['../../lib'],
            LIBS=[env.get('DYNLIB','')+'rsf'])

mpicc = env.get('MPICC')
for source in src:
    inc = env.RSF_Include(source,prefix='')
    obj = env.StaticObject(source)
    env.Ignore(inc,inc)
    env.Depends(obj,inc)

lapack = env.get('LAPACK')
if lapack:
    if not isinstance(lapack,bool):
        env.Prepend(LIBS=lapack)
    progs += ' pseudodepth'
elif root:
    place += ' pseudodepth'
    for prog in Split('pseudodepth'):
        prog = env.RSF_Place('sf'+prog,None,var='LAPACK',package='lapack')     
        env.Install(bindir,prog)

fftw = env.get('FFTW')
if fftw:
    progs += ' zomiso zomvti'
elif root:
    place += ' zomiso zomvti'
    for prog in Split('zomiso zomvti'):
        prog = env.RSF_Place('sf'+prog,None,var='FFTW',package='fftw')
        env.Install(bindir,prog)

mains = Split(progs)
for prog in mains:
    sources = ['M' + prog]
    bldutil.depends(env,sources,'M'+prog)
    env.StaticObject('M'+prog+'.c')
    prog = env.Program(prog,[x + '.o' for x in sources])
    if root:
        env.Install(bindir,prog)

mpi_mains = Split(mpi_progs)
if mpicc and fftw:
    for prog in mpi_mains:
        sources = ['M' + prog]
        bldutil.depends(env,sources,'M'+prog)
        env.StaticObject('M'+prog+'.c',CC=mpicc)
        prog = env.Program(prog,[x + '.o' for x in sources],CC=mpicc)
        if root:
            env.Install(bindir,prog)
else:
    place += mpi_progs
    for prog in mpi_mains:
        prog = env.RSF_Place('sf'+prog,None,var='MPICC',package='mpi')
        if root:
            env.Install(bindir,prog)


######################################################################
# SELF-DOCUMENTATION
######################################################################
if root:
    user = os.path.basename(os.getcwd())
    main = 'sf%s.py' % user
    
    docs = [env.Doc(prog,'M' + prog) for prog in mains+mpi_mains+Split(place)]
    env.Depends(docs,'#/framework/rsf/doc.py')  
    doc = env.RSF_Docmerge(main,docs)
    env.Install(pkgdir,doc)

Here is my operation and related information:

(base) master@MasterComputer:~/Python/Madagascar/madagascar-4.0$ ./configure --prefix=/home/master/Python/Madagascar
checking for Python ... /home/master/anaconda3/bin/python
checking Python version ... 3.9.13
checking for RSFROOT ... /home/master/Python/Madagascar
checking for SCons ... /home/master/anaconda3/bin/scons
checking SCons version ... v4.4.0.fc8d0ec215ee6cba8bc158ad40c099be0b598297
Running RSFROOT=/home/master/Python/Madagascar /home/master/anaconda3/bin/scons  config ...

scons: Reading SConscript files ...
checking platform ... (cached) linux [ubuntu]
checking for C compiler ... (cached) gcc
checking if gcc works ... yes
checking if gcc accepts '-x c -std=gnu17 -Wall -pedantic' ... yes
checking for ar ... (cached) ar
checking for rpc ... no
checking complex support ... yes
checking for X11 headers ... /usr/include
checking for X11 libraries ... /usr/lib/X11
checking for OpenGL ... yes
checking for sfpen ... (cached) xtpen
checking for ppm ... no

  Optional package: libnetpbm10-dev
checking for tiff ... no

  sfbyte2tif, sftif2byte, and tiffpen will not be built.

  Optional package: libtiff5-dev
checking for GD (PNG) ... no

  gdpen will not be built.
 
  Optional package: libgd-dev
checking for plplot ... no

  Optional package: libplplot-dev
checking for ffmpeg ... no

  Optional package: libavcodec-dev
checking for cairo (PNG) ... no

  Optional package: libcairo2-dev
checking for jpeg ... no

  sfbyte2jpg, sfjpg2byte, and jpegpen will not be built.

  Optional package: libjpeg-dev
checking for BLAS ... no

  Optional package: libblas-dev
checking for LAPACK ... no

  Optional package: liblapack-dev
checking for SWIG ... (cached) no

  Optional package: swig
checking for numpy ... (cached) yes
checking API options ... (cached) []
checking for C++ compiler ... (cached) g++
checking if g++ works ... yes
checking if g++ accepts '-std=gnu++17 -U__STRICT_ANSI__ -Wall -pedantic' ... yes
checking for MPICC ... (cached) /opt/nvidia/hpc_sdk/Linux_x86_64/23.1/comm_libs/mpi/bin/mpicc
checking if /opt/nvidia/hpc_sdk/Linux_x86_64/23.1/comm_libs/mpi/bin/mpicc works ... no

  Optional package: libopenmpi-dev
checking for MPICXX ... (cached) /opt/nvidia/hpc_sdk/Linux_x86_64/23.1/comm_libs/mpi/bin/mpicxx
checking if /opt/nvidia/hpc_sdk/Linux_x86_64/23.1/comm_libs/mpi/bin/mpicxx works ... no

  Optional package: libopenmpi-dev
checking for MPIRUN ... (cached) /opt/nvidia/hpc_sdk/Linux_x86_64/23.1/comm_libs/mpi/bin/mpirun
checking for Posix threads ... yes
checking for OpenMP ... yes
checking for CUDA ... (cached) /usr/local/cuda
checking if /opt/nvidia/hpc_sdk/Linux_x86_64/23.1/compilers/bin/nvcc works ... yes
checking for FFTW ... no

  Optional package: libfftw3-dev
checking for SuiteSparse ... no

  Optional package: libsuitesparse-dev

scons: *** Two environments with different actions were specified for the same target: sfpseudodepth
File "/home/master/Python/Madagascar/madagascar-4.0/build/user/xuxin/SConstruct", line 61, in <module>

Then

(base) master@MasterComputer:~/Python/Madagascar/madagascar-4.0$ make install
RSFROOT=/home/master/Python/Madagascar PYTHONPATH=/home/master/Python/Madagascar/lib/python3.9/site-packages /home/master/anaconda3/bin/scons install
scons: Reading SConscript files ...

scons: *** Two environments with different actions were specified for the same target: sfpseudodepth
File "/home/master/Python/Madagascar/madagascar-4.0/build/user/xuxin/SConstruct", line 61, in <module>
make: *** [Makefile:7: install] Error 2

I tried to change "configure --prfix=..." This command, but it seems that my change of address does not work.


Solution

  • Thanks for your suggestions, this issue has been solved by the developers in Madagascar.https://github.com/ahay/src/issues/285