Skip to content

Commit

Permalink
Build/Install parallel_fann & parallel_fann_cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikayex committed Jul 12, 2015
1 parent 0e6fa25 commit 5641dbb
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
FIND_PACKAGE(OpenMP)
IF(OPENMP_FOUND)
OPTION(DISABLE_PARALLEL_FANN "Disable parallel fann functions" OFF)
ENDIF(OPENMP_FOUND)

IF(NOT OPENMP_FOUND OR DISABLE_PARALLEL_FANN)
ADD_DEFINITIONS(-DDISABLE_PARALLEL_FANN)
ELSE()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF(NOT OPENMP_FOUND OR DISABLE_PARALLEL_FANN)

ADD_SUBDIRECTORY( include )

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/include)
Expand All @@ -9,6 +21,7 @@ endif (WIN32)

SET(floatfann_LIB_SRCS
floatfann.c
parallel_floatfann_cpp.cpp
)

ADD_LIBRARY(floatfann ${floatfann_LIB_SRCS})
Expand All @@ -23,6 +36,7 @@ INSTALL(TARGETS floatfann LIBRARY DESTINATION ${LIB_INSTALL_DIR}

SET(doublefann_LIB_SRCS
doublefann.c
parallel_doublefann_cpp.cpp
)

ADD_LIBRARY(doublefann ${doublefann_LIB_SRCS})
Expand Down Expand Up @@ -53,6 +67,7 @@ INSTALL(TARGETS fixedfann LIBRARY DESTINATION ${LIB_INSTALL_DIR}

SET(fann_LIB_SRCS
floatfann.c
parallel_floatfann_cpp.cpp
)

ADD_LIBRARY(fann ${fann_LIB_SRCS})
Expand Down
1 change: 1 addition & 0 deletions src/doublefann.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "fann_train_data.c"
#include "fann_error.c"
#include "fann_cascade.c"
#include "parallel_fann.c"
1 change: 1 addition & 0 deletions src/floatfann.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "fann_train_data.c"
#include "fann_error.c"
#include "fann_cascade.c"
#include "parallel_fann.c"
8 changes: 7 additions & 1 deletion src/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
########### install files ###############

install (FILES fann.h doublefann.h fann_internal.h floatfann.h fann_data.h fixedfann.h fann_activation.h fann_cascade.h fann_error.h fann_train.h fann_io.h fann_cpp.h DESTINATION ${INCLUDE_INSTALL_DIR})
IF(NOT OPENMP_FOUND OR DISABLE_PARALLEL_FANN)
SET(PARALLEL_INCLUDES "")
ELSE(NOT OPENMP_FOUND OR DISABLE_PARALLEL_FANN)
SET(PARALLEL_INCLUDES parallel_fann.h parallel_fann.hpp)
ENDIF(NOT OPENMP_FOUND OR DISABLE_PARALLEL_FANN)

install (FILES fann.h doublefann.h fann_internal.h floatfann.h fann_data.h fixedfann.h fann_activation.h fann_cascade.h fann_error.h fann_train.h fann_io.h fann_cpp.h ${PARALLEL_INCLUDES} DESTINATION ${INCLUDE_INSTALL_DIR})

27 changes: 27 additions & 0 deletions src/parallel_doublefann_cpp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Fast Artificial Neural Network Library (fann)
Copyright (C) 2003-2012 Steffen Nissen ([email protected])
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

/* Easy way to allow for build of multiple binaries */

#ifndef DISABLE_PARALLEL_FANN
#include "config.h"
#include "doublefann.h"

#include "parallel_fann_cpp.cpp"
#endif /* DISABLE_PARALLEL_FANN */
27 changes: 27 additions & 0 deletions src/parallel_floatfann_cpp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Fast Artificial Neural Network Library (fann)
Copyright (C) 2003-2012 Steffen Nissen ([email protected])
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

/* Easy way to allow for build of multiple binaries */

#ifndef DISABLE_PARALLEL_FANN
#include "config.h"
#include "floatfann.h"

#include "parallel_fann_cpp.cpp"
#endif /* DISABLE_PARALLEL_FANN */

0 comments on commit 5641dbb

Please sign in to comment.