Skip to content

configure error #12

@barronh

Description

@barronh

Hi Carlie,

I downloaded the latest version via git clone and was following the install instructions. I noticed that the source directory Makefile.template has a sed command that would be very useful to quickly apply changes to other directories. However, the configure recipe is circular -- but easily fixed.

Current recipe:

configure: ${IODIR}/Makefile ${TOOLDIR}/Makefile
	(cd $(IODIR)   ;  sed $(SEDCMD) < Makefile.$(CPLMODE).sed > Makefile )
	(cd $(TOOLDIR) ;  sed $(SEDCMD) < Makefile.$(CPLMODE).sed > Makefile )

Note that the recipe depends on the files it will produce. So, if the product files have ever been made, it will work. If they have not been made (the initial case), it will fail. The recipe actually depends on the $(CPLMODE).sed version as revised below.

configure: ${IODIR}/Makefile.$(CPLMODE).sed ${TOOLDIR}/Makefile.$(CPLMODE).sed
	(cd $(IODIR)   ;  sed $(SEDCMD) < Makefile.$(CPLMODE).sed > Makefile )
	(cd $(TOOLDIR) ;  sed $(SEDCMD) < Makefile.$(CPLMODE).sed > Makefile )

I think it would be great if the default configuration was even easier. For example, modify Makefile.template to automatically select your recommended "starting point" for users. Instead of having all options commented out, you could have a cascading set of common pairings. The code below can be inserted into Makefile.template. It defaults to nocpl and chooses sane options, but allows for any variable to be overwritten. With cpl, it again defaults to sane options and allows for overwriting options.

ifndef CPLMODE
CPLMODE    = nocpl
endif

ifndef SYSNAME
  SYSNAME = $(shell uname -s)
endif
ifndef SYSVERSION
  SYSVERSION = $(shell uname -r | cut -d. -f1)
endif
ifndef SYSARCH
  SYSARCH = $(shell uname -p)
endif
ifndef BIN
  ifeq ($(SYSNAME),Linux)
  ifneq ($(SYSVERSION),2)
    $(warning Linux version is $(SYSVERSION); newer versions use IOAPI config for version 2.)
    SYSVERSION = 2
  endif
  endif
  BIN        = $(SYSNAME)$(SYSVERSION)_$(SYSARCH)
endif
export BIN

ifndef BASEDIR
  BASEDIR    = ${PWD}
endif

ifndef INSTALL
  INSTALL    = ${HOME}
endif

ifndef LIBINST
  LIBINST    = $(INSTALL)/$(BIN)
endif

ifndef BININST
  BININST    = $(INSTALL)/$(BIN)
endif

ifndef NCFLIBS
  NCFLIBS    = $(shell nc-config --libs) $(shell nf-config --libs)
ifeq ($(CPLMOD),pncf)
  NCFLIBS = $(NCFLIBS) -lpnetcdf
endif
endif

ifndef IOAPIDEFS
ifeq ($(CPLMOD),nocpl)
  IOAPIDEFS  = 
endif
ifeq ($(CPLMOD),cpl)
  IOAPIDEFS  = "-DIOAPICPL"
endif
ifeq ($(CPLMOD),pncf)
  IOAPIDEFS  = "-DIOAPI_PNCF"
endif
endif

ifndef (PVMINCL)
PVMINCL   = 
ifeq ($(CPLMOD),cpl)
#  turn on PVM coupling mode
PVMINCL   = $(PVM_ROOT)/conf/$(PVM_ARCH).def
endif
endif

If you then moved Makefile.template to Makefile, the standard installation procedure would be simplified to

git clone https://github.com/cjcoats/ioapi-3.2
cd ioapi-3.2
make all

Of course, a more savvy user could modify the environment and/or the Makefile script. A less savvy user would be helped quite a bit.

Thanks for considering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions