Hi,Eric Hivon
I list the version of g95 I am using and post the Makefile here:
First of all, I need to install a fortran compiler which compatible with older programs.So I downloaded the g95 from http://www.g95.org
[Linux x86_64/EMT64 (32 bit D.I.):Default integer of 32 bits, compatible with older programs]
version of g95:
[root@localhost Healpix_3.20]# g95 --version
G95 (GCC 4.0.3 (g95 0.94!) Jan 17 2013)
Copyright (C) 2002-2008 Free Software Foundation, Inc.
The process and content of Makefile generated by the configure script is shown as follows:
Process:
[root@localhost Healpix_3.20]# ./configure -L
Note: the configuration directory will be /home/liyond/progs/Healpix_3.20/confdir/3_20_Linux
Welcome to Healpix 3.20
This script takes care of the configuration and compilation
of the C, C++, F90, IDL and Python packages of the Healpix distribution.
Do you want to:
(0): exit
(1): configure Healpix IDL package
(2): configure Healpix C package, and edit Makefile
(3): configure Healpix F90 package, and edit Makefile
(4): configure Healpix C++ package, and edit Makefile
(5): configure Healpix Python (healpy) package, and edit Makefile
(8): see what configuration files have been created so far
(9): edit your shell configuration file to have easier access to Healpix codes
(-1): reset
(will REMOVE the Makefile and configuration files, and exit)
(0): exit
Enter your choice (configuration of packages can be done in any order): 1
Please indicate what size of paper you will be mainly
using for your Postscript printouts (eg: a4/letter)
Enter choice [letter] a4
Note: the plot bounding box (BBox) rather than the paper size
will be used when previewing a Postcript file
Please indicate the Postscript previewer you want to use
(eg: gs, ghostview, gv, ggv, kghostview)
Enter choice [gv] gs
Please indicate the program to be used to view
the GIF and PNG files generated by Healpix (eg: display, open)
Note that xv may not be able to deal with PNG files
Enter choice [display]
Generating /home/liyond/progs/Healpix_3.20/src/idl/visu/idl_default_previewer.pro
Generating /home/liyond/progs/Healpix_3.20/confdir/3_20_Linux/idl.sh
containing:
export IDL_PATH IDL_STARTUP
OIDL_PATH="${IDL_PATH-<IDL_DEFAULT>}"
OIDL_STARTUP="${IDL_STARTUP}"
HIDL_PATH="+${HEALPIX}/src/idl:${OIDL_PATH}"
HIDL_STARTUP="${HEALPIX}/src/idl/HEALPix_startup"
alias hidl="IDL_PATH=\"${HIDL_PATH}\" ; IDL_STARTUP=${HIDL_STARTUP} ; idl ; IDL_PATH=\"${OIDL_PATH}\" ; IDL_STARTUP=${OIDL_STARTUP} "
alias hidlde="IDL_PATH=\"${HIDL_PATH}\" ; IDL_STARTUP=${HIDL_STARTUP} ; idlde ; IDL_PATH=\"${OIDL_PATH}\" ; IDL_STARTUP=${OIDL_STARTUP} "
Your home shell profile (/root/.profile)
has already been edited.
Do you want to:
(0): exit
(1): configure Healpix IDL package
(2): configure Healpix C package, and edit Makefile
(3): configure Healpix F90 package, and edit Makefile
(4): configure Healpix C++ package, and edit Makefile
(5): configure Healpix Python (healpy) package, and edit Makefile
(8): see what configuration files have been created so far
(9): edit your shell configuration file to have easier access to Healpix codes
(-1): reset
(will REMOVE the Makefile and configuration files, and exit)
(0): exit
Enter your choice (configuration of packages can be done in any order): 2
Warning: The following directories could not be found:
/home/liyond/progs/Healpix_3.20/include
/home/liyond/progs/Healpix_3.20/lib
Should I attempt to create these directories (Y|n)? Y
enter C compiler you want to use (gcc):
enter options for C compiler (-O2 -Wall):
enter archive creation (and indexing) command (ar -rsv):
do you want the HEALPix/C library to include CFITSIO-related functions ? (Y|n): Y
enter full name of cfitsio library (libcfitsio.a):
enter location of cfitsio library (/usr/local/lib):
enter location of cfitsio header fitsio.h (/usr/local/include):
A static library is produced by default. Do you also want a shared library ? (y|N) N
Editing top Makefile for C ... done.
Writing pkgconfig file: /home/liyond/progs/Healpix_3.20/lib/chealpix.pc
prefix=/home/liyond/progs/Healpix_3.20
libdir=${prefix}/lib
includedir=${prefix}/include
Name: chealpix
Description: C library for HEALPix (Hierarchical Equal-Area iso-Latitude) pixelisation of the sphere
Version: 3_20
URL: http://healpix.sourceforge.net
Requires: cfitsio
Libs: -L${libdir} -lchealpix
Cflags: -I${includedir} -fPIC
--------------
Do you want to:
(0): exit
(1): configure Healpix IDL package
(2): configure Healpix C package, and edit Makefile
(3): configure Healpix F90 package, and edit Makefile
(4): configure Healpix C++ package, and edit Makefile
(5): configure Healpix Python (healpy) package, and edit Makefile
(8): see what configuration files have been created so far
(9): edit your shell configuration file to have easier access to Healpix codes
(-1): reset
(will REMOVE the Makefile and configuration files, and exit)
(0): exit
Enter your choice (configuration of packages can be done in any order): 3
you seem to be running Linux
enter name of your F90 compiler (): g95
Note: your Fortran compiler is g95 compiler
compiled Healpix products will be:
F90_BINDIR = ./bin[suffix]
F90_INCDIR = ./include[suffix]
F90_LIBDIR = ./lib[suffix]
F90_BUILDDIR = ./build[suffix]
enter suffix for directories ():
compiled Healpix products will be:
F90_BINDIR = ./bin
F90_INCDIR = ./include
F90_LIBDIR = ./lib
F90_BUILDDIR = ./build
Warning: The following directories could not be found:
./bin
./build
Should I attempt to create these directories (Y|n)? Y
enter compilation flags for g95 compiler (-I$(F90_INCDIR) -DGFORTRAN -DG95 -w -ffree-form -fno-second-underscore):
enter optimisation flags for g95 compiler (-O3):
Fortran code will be compiled with g95 -O3 -I$(F90_INCDIR) -DGFORTRAN -DG95 -w -ffree-form -fno-second-underscore
enter name of your C compiler (gcc):
gcc: GCC compiler
enter compilation/optimisation flags for C compiler (-O3 -std=c99):
C subroutines will be compiled with gcc -O3 -std=c99
enter command for library archiving (ar -rsv):
enter full name of cfitsio library (libcfitsio.a):
enter location of cfitsio library (/usr/local/lib):
The generator of non-gaussian CMB maps (ng_sims) can optionally
produce plots of the maps Prob. Dens. Function using PGPLOT.
Do you want to enable this option ?
(this assumes that PGPLOT is already installed on your computer) (y|N)N
The Spherical Harmonics Transform (C and F90) routines used by
synfast/anafast/smoothing/plmgen
and some routines used by ud_grade and alteralm respectively
have a parallel implementation (based on OpenMP).
Do you want to use :
0) the standard serial implementation ?
1) the parallel implementation
Enter choice (1): 1
Healpix+OpenMP not tested for "g95 compiler" under "Linux"
Contact healpix at jpl.nasa.gov if you already used OpenMP in this configuration.
Will perform serial implementation of C and F90 routines instead.
Do you want a Position Independent Compilation (option "-fPIC")
(recommended if the Healpix-F90 library is to be linked to external codes) (Y|n): Y
Experimental feature:
A static library is produced by default. Do you rather want a shared/dynamic library ? (y|N) N
Generating /home/liyond/progs/Healpix_3.20/confdir/3_20_Linux/f90.sh
Editing top Makefile for F90 ... done.
Writing pkgconfig file: /home/liyond/progs/Healpix_3.20/lib/healpix.pc
prefix=/home/liyond/progs/Healpix_3.20
suffix=
exec_prefix=${prefix}/bin${suffix}
libdir=${prefix}/lib${suffix}
includedir=${prefix}/include${suffix}
Name: HEALPix
Description: F90 library for HEALPix (Hierarchical Equal-Area iso-Latitude) pixelisation of the sphere
Version: 3_20
URL: http://healpix.sourceforge.net
Requires: cfitsio >= 3.14
Libs: -L${libdir} -lhealpix -lhpxgif
Cflags: -I${includedir} -fPIC
--------------
Do you want to:
(0): exit
(1): configure Healpix IDL package
(2): configure Healpix C package, and edit Makefile
(3): configure Healpix F90 package, and edit Makefile
(4): configure Healpix C++ package, and edit Makefile
(5): configure Healpix Python (healpy) package, and edit Makefile
(8): see what configuration files have been created so far
(9): edit your shell configuration file to have easier access to Healpix codes
(-1): reset
(will REMOVE the Makefile and configuration files, and exit)
(0): exit
Enter your choice (configuration of packages can be done in any order): 4
enter location of cfitsio library (/usr/local/lib):
enter location of cfitsio header fitsio.h (/usr/local/include):
Available configurations for C++ compilation are:
1: basic_gcc
2: generic_gcc
3: linux_icc
4: osx
5: osx_icc
0: None of the above (will send you back to main menu).
You can create your own C++ configuration in /home/liyond/progs/Healpix_3.20/src/cxx/config/config.*
Choose one number: 2
will compile with generic_gcc configuration
Generating /home/liyond/progs/Healpix_3.20/confdir/3_20_Linux/cpp.sh
edit top Makefile for C++ ... done.
Do you want to:
(0): exit
(1): configure Healpix IDL package
(2): configure Healpix C package, and edit Makefile
(3): configure Healpix F90 package, and edit Makefile
(4): configure Healpix C++ package, and edit Makefile
(5): configure Healpix Python (healpy) package, and edit Makefile
(8): see what configuration files have been created so far
(9): edit your shell configuration file to have easier access to Healpix codes
(-1): reset
(will REMOVE the Makefile and configuration files, and exit)
(0): exit
Enter your choice (configuration of packages can be done in any order): 5
Enter python command [python]
edit top Makefile for Python (healpy) ...setup.py
done.
Do you want to:
(0): exit
(1): configure Healpix IDL package
(2): configure Healpix C package, and edit Makefile
(3): configure Healpix F90 package, and edit Makefile
(4): configure Healpix C++ package, and edit Makefile
(5): configure Healpix Python (healpy) package, and edit Makefile
(8): see what configuration files have been created so far
(9): edit your shell configuration file to have easier access to Healpix codes
(-1): reset
(will REMOVE the Makefile and configuration files, and exit)
(0): exit
Enter your choice (configuration of packages can be done in any order): 9
Your home shell profile (/root/.profile)
has already been edited.
Do you want to:
(0): exit
(1): configure Healpix IDL package
(2): configure Healpix C package, and edit Makefile
(3): configure Healpix F90 package, and edit Makefile
(4): configure Healpix C++ package, and edit Makefile
(5): configure Healpix Python (healpy) package, and edit Makefile
(8): see what configuration files have been created so far
(9): edit your shell configuration file to have easier access to Healpix codes
(-1): reset
(will REMOVE the Makefile and configuration files, and exit)
(0): exit
Enter your choice (configuration of packages can be done in any order): 0
You can run "(GNU)make" to build all the packages configured so far,
and "(GNU)make test" to test them.
Good Bye !
Content:
ALL = c-all cpp-all f90-all healpy-all
TESTS = c-test cpp-test f90-test healpy-test
CLEAN = c-clean cpp-clean f90-clean healpy-clean
TIDY = c-tidy cpp-tidy f90-tidy healpy-tidy
DISTCLEAN = c-distclean cpp-distclean f90-distclean healpy-distclean
RM = rm -f
HEALPIX = /home/liyond/progs/Healpix_3.20
F90_BINDIR = /home/liyond/progs/Healpix_3.20/bin
F90_INCDIR = /home/liyond/progs/Healpix_3.20/include
F90_LIBDIR = /home/liyond/progs/Healpix_3.20/lib
FITSDIR = /usr/local/lib
LIBFITS = cfitsio
F90_BUILDDIR = /home/liyond/progs/Healpix_3.20/build
F90_FFTSRC = healpix_fft
F90_ADDUS =
F90_PARALL =
F90_FC = g95
F90_FFLAGS = -O3 -I$(F90_INCDIR) -DGFORTRAN -DG95 -w -ffree-form -fno-second-underscore -fPIC
F90_CC = gcc
F90_CFLAGS = -O3 -std=c99 -fPIC
F90_LDFLAGS = -L$(F90_LIBDIR) -L$(FITSDIR) -lhealpix -lhpxgif -l$(LIBFITS)
F90_AR = ar -rsv
Then compiling:
[root@localhost Healpix_3.20]# make
........................
.............
In file included from /home/liyond/progs/Healpix_3.20/src/f90/sharp/libsharp_healpix_f/sharp_healpix_f.c:5:0,
from /home/liyond/progs/Healpix_3.20/src/f90/sharp/libsharp_all.c:11:
/home/liyond/progs/Healpix_3.20/src/f90/sharp/libsharp_healpix_f/ls_cfortran.h:226:3: error: #error "cfortran.h: Can't find your environment among: - GNU gcc (g77) on Linux. - MIPS cc and f77 2.0. (e.g. Silicon Graphics, DECstations, ...)
- IBM AIX XL C and FORTRAN Compiler/6000 Version 01.01.0000.0000
- VAX VMS CC 3.1 and FORTRAN 5.4.
- Alpha VMS DEC C 1.3 and DEC FORTRAN 6.0.
- Alpha OSF DEC C and DEC Fortran for OSF/1 AXP Version 1.2
- Apollo DomainOS 10.2 (sys5.3) with f77 10.7 and cc 6.7.
- CRAY
- NEC SX-4 SUPER-UX
- CONVEX
- Sun
- PowerStation Fortran with Visual C++
- HP9000s300/s700/s800 Latest test with: HP-UX A.08.07 A 9000/730
- LynxOS: cc or gcc with f2c.
- VAXUltrix: vcc,cc or gcc with f2c. gcc or cc with f77. - f77 with vcc works; but missing link magic for f77 I/O. - NO fort. None of gcc, cc or vcc generate required names.
- f2c/g77: Use #define f2cFortran, or cc -Df2cFortran
- gfortran: Use #define gFortran, or cc -DgFortran (also necessary for g77 with -fno-f2c option)
- NAG f90: Use #define NAGf90Fortran, or cc -DNAGf90Fortran
- Absoft UNIX F77: Use #define AbsoftUNIXFortran or cc
-DAbsoftUNIXFortran
- Absoft Pro Fortran: Use #define AbsoftProFortran
- Portland Group Fortran: Use #define pgiFortran
- Intel Fortran: Use #define INTEL_COMPILER"
make[1]: [/home/liyond/progs/Healpix_3.20/build/sharp/libsharp_all.o] Error 1
make[1]: Leaving directory `/home/liyond/progs/Healpix_3.20/src/f90/sharp'
make: [f90-libsharp] Error 2
Anonymous
I'm not sure I can help you with the g95 problem, but I have a slightly related question:
You write:
I'm not aware that g95 has better support for "older programs" than gfortran. Is there a concrete problem you have with gfortran that goes away when you use g95?
See https://sourceforge.net/p/healpix/bugs/59/