forked from dftlibs/xcfun
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows support by Alexei Yakovlev (Makefiles for Visual C++
and fortran symbol in uppercase).
- Loading branch information
Showing
4 changed files
with
96 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#This file probably requires GNU Make, but should be easily | ||
#convertible to regular Make format. | ||
|
||
PATHS:=-Iinclude -Isrc -Isrc/taylor -Isrc/functionals | ||
CFLAGS+=$(PATHS) | ||
CXXFLAGS+=$(PATHS) | ||
|
||
BASE_OBJ:=src/xcfun.obj src/functional.obj src/parameters.obj \ | ||
src/evaluators.obj src/fortran.obj src/potential.obj | ||
FUN_OBJ:=$(patsubst %.cpp,%.obj,$(wildcard src/functionals/*.cpp)) | ||
|
||
lib: lib/libxcfun.lib | ||
|
||
lib/libxcfun.lib: $(BASE_OBJ) $(FUN_OBJ) include/xcfun_autogen.h fortran/xcfun_autogen.f90 | ||
lib -OUT:$@ $(BASE_OBJ) $(FUN_OBJ) | ||
|
||
src/parameters.obj: src/parameters.cpp src/parameters.h src/functionals/list_of_parameters.h | ||
|
||
src/fortran.obj: src/fortran.c include/xcfun_autogen.h | ||
|
||
geninterface: src/geninterface.cpp | ||
$(CXX) $(CXXFLAGS) $^ -Fe$@ | ||
|
||
include/xcfun_autogen.h: geninterface src/functionals/list_of_parameters.h | ||
./geninterface | ||
|
||
fortran/xcfun_autogen.f90: geninterface src/functionals/list_of_parameters.h | ||
./geninterface | ||
|
||
funeval: test/funeval.c lib/libxcfun.lib | ||
$(CC) $(CFLAGS) $(LIBS) $< -Fe$@ lib/libxcfun.lib | ||
|
||
testall: test/testall.c lib/libxcfun.lib | ||
$(CC) $(CFLAGS) $(LIBS) $< -Fe$@ lib/libxcfun.lib | ||
|
||
example_fortran: fortran/xcfun_autogen.obj fortran/xcfun_module.obj fortran/example.obj lib/libxcfun.lib | ||
$(FC) $(FFLAGS) $(LIBS) -o $@ $^ lib/libxcfun.lib | ||
|
||
clean: | ||
rm -f `find . -name '*.o' -o -name '*~'` testall funeval lib/libxcfun.lib include/xcfun_autogen.h fortran/xcfun_autogen.f90 example_fortran_ | ||
|
||
.SUFFIXES: .f90 .obj | ||
|
||
.f90.obj: | ||
$(FC) $(FFLAGS) -c -Fo$*.obj $*.f90 | ||
|
||
.cpp.obj: | ||
$(CXX) $(CXXFLAGS) -c -Fo$*.obj $*.cpp | ||
|
||
.c.obj: | ||
$(CXX) $(CXXFLAGS) -c -Fo$*.obj $*.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Compile time options: | ||
# -DNDEBUG Turn off run time checks in production calculations to gain speed | ||
# To compile without -lstdc++ needed use (g++) -fno-rtti -fno-exceptions | ||
# -fno-threadsafe-statics. Note the last option. | ||
|
||
# C++ compiler and flags | ||
CXX=cl | ||
CC=cl | ||
CFLAGS=-Za -O2 -DNDEBUG -DFTN_UPPERCASE | ||
CXXFLAGS=$(CFLAGS) | ||
|
||
# Fortran compiler and flags (used for fortran/example.f90) | ||
FC=ifort | ||
FFLAGS=-unix -nologo -O3 | ||
|
||
include Makefile.common_win |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters