diff options
-rw-r--r-- | CMakeLists.txt | 17 | ||||
-rw-r--r-- | example/Makefile | 123 | ||||
-rw-r--r-- | makefile | 63 |
3 files changed, 133 insertions, 70 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..5a0e5f6 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 2.6) +PROJECT(opt_utilities,CPP) + +add_subdirectory(core) +add_subdirectory(data_sets) +add_subdirectory(interface) +add_subdirectory(example) +add_subdirectory(methods) +add_subdirectory(misc) +add_subdirectory(models) +add_subdirectory(statistics) +add_subdirectory(utilities) +add_subdirectory(vmodels) +include_directories (${opt_utilities_SOURCE_DIR}) + +set(LIBRARY_OUTPUT_PATH,lib) +ADD_LIBRARY(opt STATIC interface/opt.cc) diff --git a/example/Makefile b/example/Makefile index fe3e168..c14fb22 100644 --- a/example/Makefile +++ b/example/Makefile @@ -1,13 +1,122 @@ -target=test_optimizer test_fitter +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.6 -all:$(target) +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target +#============================================================================= +# Special targets provided by cmake. -test_optimizer:test_optimizer.cpp - g++ -o $@ $< -I ../ -O3 -g +# Disable implicit rules so canoncical targets will work. +.SUFFIXES: -test_fitter:test_fitter.cpp - g++ -o $@ $< -I ../ -O3 -g +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = +.SUFFIXES: .hpux_make_needs_suffix_list + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# The program to use to edit the cache. +CMAKE_EDIT_COMMAND = /usr/bin/ccmake + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/astrojhgu/src/opt_utilities + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/astrojhgu/src/opt_utilities + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + cd /home/astrojhgu/src/opt_utilities && $(CMAKE_COMMAND) -E cmake_progress_start /home/astrojhgu/src/opt_utilities/CMakeFiles /home/astrojhgu/src/opt_utilities/example/CMakeFiles/progress.make + cd /home/astrojhgu/src/opt_utilities && $(MAKE) -f CMakeFiles/Makefile2 example/all + $(CMAKE_COMMAND) -E cmake_progress_start /home/astrojhgu/src/opt_utilities/CMakeFiles 0 +.PHONY : all + +# The main clean target clean: - rm -f $(target) + cd /home/astrojhgu/src/opt_utilities && $(MAKE) -f CMakeFiles/Makefile2 example/clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /home/astrojhgu/src/opt_utilities && $(MAKE) -f CMakeFiles/Makefile2 example/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /home/astrojhgu/src/opt_utilities && $(MAKE) -f CMakeFiles/Makefile2 example/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /home/astrojhgu/src/opt_utilities && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... rebuild_cache" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /home/astrojhgu/src/opt_utilities && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/makefile b/makefile deleted file mode 100644 index bd59956..0000000 --- a/makefile +++ /dev/null @@ -1,63 +0,0 @@ -OPT_HEADS=models/beta1d.hpp statistics/chisq.hpp models/lin1d.hpp\ - models/pl1d.hpp models/bl1d.hpp\ - statistics/leastsq.hpp\ - core/fitter.hpp models/models.hpp\ - core/opt_traits.hpp\ - methods/powell/powell_method.hpp models/bpl1d.hpp\ - core/freeze_param.hpp\ - models/gauss1d.hpp core/optimizer.hpp\ - misc/bootstrap.hpp\ - interface/optdl.hpp\ - models/mul_model.hpp\ - models/add_model.hpp\ - -LDL=-ldl - -#export CXX=g++ -#export CC=gcc -export AR = ar rv -export RANLIB = ranlib -export RM=rm -f -export CCFLAGS=-DNDEBUG -ansi -pedantic -g -O2 -Wall -c -I . -g -export CXXFLAGS=-DNDEBUG -ansi -pedantic -g -O2 -Wall -c -I . -g - - -INC=-I. -I/usr/include/gsl/ -LIB=-lgsl -lgslcblas -OPT_OBJ=models/models.o version_ctrl.o models/strmodel1d.o - -TARGET=liboptcall test_dl.so models/strmodel1d.o models/models.o - -all: $(TARGET) - -models/models.o:models/models.cc ${OPT_HEADS} - $(CXX) -c $< -o $@ ${INC} ${CXXFLAGS} - -version_ctrl.o:version_ctrl.cc - $(CXX) -c $< ${CXXFLAGS} - -bin/test.o:test.cc ${OPT_HEADS} - $(CXX) -c $< -o $@ ${INC} ${CXXFLAGS} --ansi - -test:${OPT_OBJ} bin/test.o - $(CXX) bin/test.o models/strmodel1d.o models/models.o version_ctrl.o -o $@ ${LIB} - -test_dl.so:models/dlmodel_template.c - $(CC) $< --shared -o $@ - - -models/strmodel1d.o:models/strmodel1d.cc models/strmodel1d.hpp - $(CXX) -c $< -o $@ $(CXXFLAGS) - - -liboptcall: - make -C interface - -clean: - rm -f `find .|grep \~` - rm -f `find .|grep '\.o'` - make -C interface clean - -distclean:clean - rm -f `find . -iname *.a` - rm -f $(TARGET) |