diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..ee622f0c04994528091b646b048c838182acdade --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,56 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +project(EASEA) +SET(CMAKE_STATIC_LIBRARY_PREFIX="") +INCLUDE_DIRECTORIES(libeasea/include alexyacc/include boost) + +ADD_DEFINITIONS(-g -w -Wno-deprecated -Wno-write-strings -fmessage-length=0 ) + + +if(WIN32) + FILE(GLOB libeasea_src_win "libeasea/win32/*.cpp" ) +endif(WIN32) + + +#Alexyacc static library +FILE(GLOB libalex_src alexyacc/*.cpp) +ADD_LIBRARY( libalex STATIC ${libalex_src} ) + + +#Libeasea static library +FILE(GLOB libeasea_src libeasea/*.cpp ) +ADD_LIBRARY( libeasea STATIC ${libeasea_src} ${libeasea_src_win}) +SET_TARGET_PROPERTIES(libeasea PROPERTIES OUTPUT_NAME "libeasea" PREFIX "" COMPILE_FLAGS "-O3") + + +#Boost program_options static library +FILE(GLOB boost_src boost/*.cpp) +ADD_LIBRARY( program_options STATIC ${boost_src} ) +SET_TARGET_PROPERTIES(program_options PROPERTIES OUTPUT_NAME "program_options" PREFIX "" COMPILE_FLAGS "-O2") + + +SET(easea_src + EaseaLex.cpp + EaseaParse.cpp + EaseaSym.cpp + EaseaYTools.cpp) + + +ADD_EXECUTABLE(easea ${easea_src}) +SET_TARGET_PROPERTIES(easea PROPERTIES COMPILE_FLAGS "") +TARGET_LINK_LIBRARIES(easea libeasea libalex program_options) +ADD_CUSTOM_COMMAND(TARGET easea POST_BUILD + COMMAND $(CMAKE_COMMAND) -E copy libeasea.a libeasea/ + COMMAND $(CMAKE_COMMAND) -E copy program_options.a boost/ + ) + +INSTALL(TARGETS easea DESTINATION bin/ CONFIGURATIONS local) +INSTALL(TARGETS libeasea DESTINATION libeasea/ CONFIGURATIONS local) +INSTALL(TARGETS program_options DESTINATION boost/ CONFIGURATIONS local) +INSTALL(TARGETS easea DESTINATION /usr/local/easea/bin CONFIGURATIONS global) +INSTALL(TARGETS libeasea DESTINATION /usr/local/easea/libeasea CONFIGURATIONS global) +INSTALL(TARGETS program_options DESTINATION /usr/local/easea/boost CONFIGURATIONS global) +INSTALL(DIRECTORY tpl DESTINATION /usr/local/easea/ CONFIGURATIONS global) +INSTALL(DIRECTORY "libeasea/include" DESTINATION "/usr/local/easea/libeasea/" CONFIGURATIONS global) +INSTALL(DIRECTORY boost/boost DESTINATION /usr/local/easea/boost/ CONFIGURATIONS global) +INSTALL(FILES easeagrapher/EaseaGrapher.jar DESTINATION /usr/local/easea/easeagrapher CONFIGURATIONS global) diff --git a/INSTALL.txt b/INSTALL.txt index cfd3b73d79aa2917aba97464105aa9a5ad51f85a..8b137891791fe96927ad78e64b0aad7bded08bdc 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -1,47 +1 @@ - -EASEA Quick Installation Guidelines ------------------------------------ - -1. Check dependencies: the following packages must be installed: - -g++ compiler -libboost: to install it on ubuntu: - sudo apt-get install libboost-program-options-dev - -2. EASEA source code: - -The source code can be obtained either from sourceforge or, for -programmers involved in the EASEA development, from its GIT repository. - -2.1 Downloading it from sourceforge: - -http://sourceforge.net/projects/easea/ - -2.2 Retrieving it from GIT (for developers in the EASEA team only): - -generating a public-private SSH-RSA key pair: - -ssh-keygen -t rsa - -make sure that your public SSH is registered with the manager of the -repository (currently Ogier Maitre), and that he has granted access to -you. - -retrieving the latest version from the GIT repository: - -git clone git@atia.u-strasbg.fr:easea.git - -3. Compiling EASEA: - -cd -make -export EZ_PATH=`pwd`/ - -4. Running an example: - -cd examples/weierstrass_std/ -$EZ_PATH/easea weierstrass.ez -make -./weierstrass - diff --git a/Makefile b/Makefile index a5ece6dfc2318477091b25f25883889840ac07ac..140bc15f2f8ad78cdca980ab6731c0a18212a0d3 100644 --- a/Makefile +++ b/Makefile @@ -31,8 +31,8 @@ else # # Installation: # To install EASEA into your system, type: - # "sudo make install". - # EASEA will be installed into /usr/local/easa/ directory, + # ". install.sh ". + # EASEA will be installed into /usr/local/easea/ directory, # including, the binary, its libraries and the templates. # Finaly, environment variables will be updated (EZ_PATH and PATH), ifeq ($(UNAME),Darwin) @@ -49,15 +49,7 @@ ifeq ($(UNAME),Darwin) else # .bashrc file (EZ_PATH and). To do so type: endif - # "make dev_vars". - # - # Finally after having "install" or "dev_vars", reload bash config file -ifeq ($(UNAME),Darwin) - # (by "exec bash -l" or "source ~/.bash_profile", use easea with: -else - # (by "exec bash" or "source ~/.bashrc", use easea with: -endif - # easea weierstrass.ez + # ". install.sh local". # # Thanks for using EASEA. # @@ -71,7 +63,7 @@ endif # $(CXX) $(CPPFLAGS) $(LDFLAGS) $^ -o $@ -lalex -install:vars +install: mkdir -p /usr/local/easea/ /usr/local/easea/bin /usr/local/easea/tpl /usr/local/easea/libeasea/include /usr/local/easea/boost /usr/local/easea/easeagrapher/ cp bin/easea /usr/local/easea/bin/ cp tpl/* /usr/local/easea/tpl/ @@ -80,22 +72,7 @@ install:vars cp boost/program_options.a /usr/local/easea/boost cp -r boost/boost/ /usr/local/easea/boost/boost/ cp easeagrapher/EaseaGrapher.jar /usr/local/easea/easeagrapher/ -vars:profile_ -ifeq ($(UNAME), Darwin) - @echo "export EZ_PATH=/usr/local/easea/">>$PROFILE - @echo "export PATH=\$$PATH:/usr/local/easea/bin:" >>$PROFILE -else - @echo "\nexport EZ_PATH=/usr/local/easea/">>$(HOME)/.bashrc - @echo "export PATH=\$$PATH:/usr/local/easea/bin:" >>$(HOME)/.bashrc - @echo "PATH and EZ_PATH variables have been set" -endif -profile_: -ifeq ($(wildcard "$(HOME)/.profile"),) - PROFILE="$(HOME)/.bash_profile" -else - PROFILE="$(HOME)/.profile" -endif build: @test -d build || mkdir build || echo "Cannot make dir build" @@ -103,18 +80,6 @@ bin: @test -d bin || mkdir bin || echo "Cannot make dir bin" -dev_vars: -ifeq ($(UNAME), Darwin) - @echo >> $(HOME)/.bash_profile - @echo "export EZ_PATH=$(PWD)/">>$(HOME)/.bash_profile - @echo "export PATH=\$$PATH:$(PWD)/bin/">>$(HOME)/.bash_profile -else - @echo >> $(HOME)/.bashrc - @echo "export EZ_PATH=$(PWD)/">>$(HOME)/.bashrc - @echo "export PATH=\$$PATH:$(PWD)/bin/">>$(HOME)/.bashrc -endif - - build/EaseaParse.o: EaseaParse.cpp EaseaLex.cpp $(CXX) $(CPPFLAGS) $< -o $@ -c -w build/EaseaLex.o: EaseaLex.cpp diff --git a/Makefile.old b/Makefile.old new file mode 100644 index 0000000000000000000000000000000000000000..140bc15f2f8ad78cdca980ab6731c0a18212a0d3 --- /dev/null +++ b/Makefile.old @@ -0,0 +1,130 @@ +UNAME := $(shell uname) +ifeq ($(shell uname -o 2>/dev/null),Msys) + OS := MINGW +endif +EXEC = bin/easea +CPPFLAGS += -DUNIX_OS -Ialexyacc/include/ -g -Wno-deprecated -DDEBUG -DLINE_NUM_EZ_FILE +LDFLAGS = + +OBJ= build/EaseaSym.o build/EaseaParse.o build/EaseaLex.o alexyacc/libalex.a build/EaseaYTools.o boost/program_options.a libeasea/libeasea.a + +#ifeq ($(UNAME),Darwin) +$(EXEC):build bin $(OBJ) + $(CXX) $(CPPFLAGS) $(LDFLAGS) $(OBJ) -o $@ +ifneq ("$(OS)","") + # + # Congratulations ! It looks like you compiled EASEA successfully. + # + # You can use easea from this directory by typing : + # For example : + # easea.exe examples\weierstrass_std\weierstrass.ez + # Go to the target directory and type make -f weierstrass.mak + # + # Thanks for using EASEA. + # +else + # + # Congratulations ! It looks like you compiled EASEA successfully. + # + # You can now install easea into your system or use it from + # its current directory. + # + # Installation: + # To install EASEA into your system, type: + # ". install.sh ". + # EASEA will be installed into /usr/local/easea/ directory, + # including, the binary, its libraries and the templates. + # Finaly, environment variables will be updated (EZ_PATH and PATH), +ifeq ($(UNAME),Darwin) + # into your .bash_profile file. +else + # into your .bashrc file. +endif + # + # Local Usage: + # All EASEA elements will stay in the current directory, + # but some environment variables need to be updated into your +ifeq ($(UNAME),Darwin) + # .bash_profile file (EZ_PATH and). To do so type: +else + # .bashrc file (EZ_PATH and). To do so type: +endif + # ". install.sh local". + # + # Thanks for using EASEA. + # +endif + +# $(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.so +# $(CXX) $(CPPFLAGS) $(LDFLAGS) $^ -o $@ + + +# $(EXEC)_bin:EaseaSym.o EaseaParse.o EaseaLex.o +# $(CXX) $(CPPFLAGS) $(LDFLAGS) $^ -o $@ -lalex + + +install: + mkdir -p /usr/local/easea/ /usr/local/easea/bin /usr/local/easea/tpl /usr/local/easea/libeasea/include /usr/local/easea/boost /usr/local/easea/easeagrapher/ + cp bin/easea /usr/local/easea/bin/ + cp tpl/* /usr/local/easea/tpl/ + cp libeasea/include/* /usr/local/easea/libeasea/include/ + cp libeasea/libeasea.a /usr/local/easea/libeasea/ + cp boost/program_options.a /usr/local/easea/boost + cp -r boost/boost/ /usr/local/easea/boost/boost/ + cp easeagrapher/EaseaGrapher.jar /usr/local/easea/easeagrapher/ + + +build: + @test -d build || mkdir build || echo "Cannot make dir build" +bin: + @test -d bin || mkdir bin || echo "Cannot make dir bin" + + +build/EaseaParse.o: EaseaParse.cpp EaseaLex.cpp + $(CXX) $(CPPFLAGS) $< -o $@ -c -w +build/EaseaLex.o: EaseaLex.cpp + $(CXX) $(CPPFLAGS) $< -o $@ -c -w + + +build/%.o:%.cpp + $(CXX) $(CPPFLAGS) -c -o $@ $< + +#compile library for alex and ayacc unix version +alexyacc/libalex.so:alexyacc/*.cpp + cd alexyacc && make libalex.so + +alexyacc/libalex.a:alexyacc/*.cpp + cd alexyacc && make libalex.a + +#ifeq ($(UNAME),Darwin) +boost/program_options.a:boost/*.cpp + cd boost && make program_options.a +#endif #OS + +#compile libeasea +libeasea/libeasea.a:libeasea/*.cpp + cd libeasea && make libeasea.a + +clean: + rm -f build/*.o $(EXEC) $(EXEC)_bin + cd alexyacc && make clean + cd libeasea && make clean + cd boost && make clean +#ifeq ($(UNAME),Darwin) + cd boost && make clean +#endif + +#install:$(EXEC) +# sudo cp $< /usr/bin/dev-easea + +#ifeq ($(UNAME),Linux) +#realclean: clean +# rm -f EaseaParse.cpp EaseaParse.h EaseaLex.cpp EaseaLex.h + +# AT commented these lines, because they imply the presence of wine + programs in a specific location +#EaseaParse.cpp: EaseaParse.y +# wine ~/.wine/drive_c/Program\ Files/Parser\ Generator/BIN/ayacc.exe $< -Tcpp -d + +#EaseaLex.cpp: EaseaLex.l +# wine ~/.wine/drive_c/Program\ Files/Parser\ Generator/BIN/ALex.exe $< -Tcpp -i +#endif diff --git a/install.sh b/install.sh new file mode 100755 index 0000000000000000000000000000000000000000..211718a2a3c4ccf2df8a9ad5d4b30f6c77e68bdd --- /dev/null +++ b/install.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +#Select the correct shell configuration file +USER_HOME=$HOME +PROFILE="$USER_HOME/.bashrc" # default +if [ "$(uname)" = "Linux" ]; then + + #Linux case + PROFILE="$USER_HOME/.bashrc" + +else + + #OSX case + if [ -f "$USER_HOME/.profile" ]; then + PROFILE="$USER_HOME/.profile" + else + PROFILE="$USER_HOME/.bash_profile" + fi + +fi + +#Do the installation +if [ "$1" = "local" ]; then + echo "Installing easea 1.0.3 locally" + + echo "Exporting and setting environment variables" + export EZ_PATH="$PWD/" + export PATH="$PATH:$PWD/bin" + echo "export EZ_PATH=$EZ_PATH">>$PROFILE + echo "export PATH=\$PATH:$PWD/bin" >>$PROFILE + +else + echo "Installing easea 1.0.3 in /usr/local/easea" + sudo make install > /dev/null + + echo "Exporting and setting environment variables" + export EZ_PATH="/usr/local/easea/" + export PATH="$PATH:/usr/local/easea/bin" + echo "export EZ_PATH=$EZ_PATH">>$PROFILE + echo "export PATH=\$PATH:/usr/local/easea/bin" >>$PROFILE + +fi + diff --git a/libeasea/Makefile b/libeasea/Makefile index 79ec9cd71d51cbc9b2b85a6852cd6224dec85f1c..da050fcd94211249842e0630b21c0fad6c0d2bda 100755 --- a/libeasea/Makefile +++ b/libeasea/Makefile @@ -11,7 +11,7 @@ OBJS = CRandomGenerator.o CSelectionOperator.o CEvolutionaryAlgorithm.o\ CComUDPLayer.o CStats.o CGPNode.o ifneq ("$(OS)","") -OBJS += inet_pton.o +OBJS += win32/inet_pton.o endif #ifeq ($(EZ_CUDA),1) diff --git a/libeasea/inet_pton.cpp b/libeasea/win32/inet_pton.cpp similarity index 100% rename from libeasea/inet_pton.cpp rename to libeasea/win32/inet_pton.cpp