Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libnwchem patch (compile as shared) #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions src/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ifeq ($(XLFMAC),y)
endif

NWBINNAME = nwchem
NWLIBNAME = libnwchem.so

#
# This should be the first target so that a simple make builds
Expand All @@ -29,7 +30,16 @@ endif
.PHONY: nwchem_config

.PRECIOUS: $(BINDIR)/$(NWBINNAME) $(NWBINNAME)
all $(BINDIR)/$(NWBINNAME) $(NWBINNAME): directories libraries

all: nwchem

nwchem: $(BINDIR)/$(NWBINNAME)
echo "Built $@"

libnwchem: $(LIBDIR)/$(NWLIBNAME)
echo "Built $@"

$(BINDIR)/$(NWBINNAME): directories libraries
@/bin/rm -f nwchem.o stubs.o
$(MAKE) nwchem.o stubs.o
ifeq ($(TARGET),SOLARIS)
Expand All @@ -40,7 +50,7 @@ ifdef SUMO
$(AR) rcv $(LIBDIR)/libnwchem-sumo.a $(LIBDIR)/objs/*.o
$(RANLIB) $(LIBDIR)/libnwchem-sumo.a
endif
/bin/rm -f nwchem.o stubs.o
@/bin/rm -f nwchem.o stubs.o
$(INSTALL)
#
# This to link only and avoid tedious subdir makes
Expand All @@ -50,6 +60,20 @@ PFLAGS = -messages=first -leaks-at-exit=yes -follow-child-processes=yes \
-windows=no -cache-dir=/tmp/purify/cache -best-effort
#PURIFY = purify $(PFLAGS)

$(LIBDIR)/$(NWLIBNAME): directories libraries
@/bin/rm -f libnwchem.o stubs.o
$(MAKE) libnwchem.o stubs.o
ifeq ($(TARGET),SOLARIS)
/bin/rm -f $(LIBDIR)/$(NWLIBNAME)
endif
$(LINK.f) -shared -fPIC \
-o $(LIBDIR)/$(NWLIBNAME) libnwchem.o stubs.o \
-Wl,--allow-multiple-definition \
-Wl,--whole-archive -lnwctask -lnwcutil -Wl,--no-whole-archive \
-Wl,--start-group $(LIBS) -Wl,--end-group -Wl,--no-undefined
@/bin/rm -f libnwchem.o stubs.o
$(INSTALL)

link nwchem_link:
@/bin/rm -f nwchem.o stubs.o
$(MAKE) nwchem.o stubs.o
Expand All @@ -61,7 +85,6 @@ ifdef SUMO
$(AR) rcv $(LIBDIR)/libnwchem-sumo.a $(LIBDIR)/objs/*.o
$(RANLIB) $(LIBDIR)/libnwchem-sumo.a
endif
# /bin/rm -f nwchem.o stubs.o
$(INSTALL)

ccalink:
Expand Down Expand Up @@ -99,7 +122,7 @@ endif
# This dependency so that includes which are made by libraries rule
# are updated before nwchem is compiled

libraries:
libraries: $(SUBDIRS)
@for dir in $(SUBDIRS); do \
echo Making $@ in $$dir; \
$(MAKE) -C $$dir || exit 1 ; \
Expand Down Expand Up @@ -195,6 +218,7 @@ ifeq ($(NWCHEM_MODULES),)
else
$(MAKE) -C config -f make_nwchem_config NWCHEM_MODULES="$(NWCHEM_MODULES)"
endif
touch $@

#
# This is a convenience target that will make the TAGS file for current
Expand Down Expand Up @@ -234,7 +258,7 @@ stripdepend:

.PHONY: source
source:
cat stubs.F nwchem.F > source
cat stubs.F nwchem.F libnwchem.F > source
ifdef SUBDIRS
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@ || exit 1 ; \
Expand Down
2 changes: 2 additions & 0 deletions src/diana/dia_rdhdr.F
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ subroutine dia_rdhdr(sgmnam)
#include "dia_common.fh"
#include "mafdecls.fh"
c
c throws dia_rdhdr.F: undefined reference to `ftell_' on
c GNU Fortran (Ubuntu 4.9.1-16ubuntu6) 4.9.1
integer ftell
external ftell
c
Expand Down
Loading