Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/nn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Bottou <leon@bottou.org>2013-11-27 07:01:06 +0400
committerLeon Bottou <leon@bottou.org>2013-11-27 07:03:45 +0400
commit60947473ba346a04c794dd63335633640351ae46 (patch)
tree2064f671bbad50d20ecbe62157a2afb17a31dfa5
parent4734d2431b63acaa3b26199cc7dfbb770b6566a4 (diff)
less strict about ansi libraries, less warnings
-rw-r--r--CMakeLists.txt8
-rw-r--r--generic/SoftPlus.c2
2 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2bfd582..b432b65 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,9 +2,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
CMAKE_POLICY(VERSION 2.6)
FIND_PACKAGE(Torch REQUIRED)
-IF("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89 -pedantic")
-ENDIF()
+INCLUDE(CheckCCompilerFlag)
+CHECK_C_COMPILER_FLAG(-pedantic C_HAS_PEDANTIC)
+IF (C_HAS_PEDANTIC)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic")
+ENDIF ()
SET(src init.c)
diff --git a/generic/SoftPlus.c b/generic/SoftPlus.c
index b4f62f7..49f50a7 100644
--- a/generic/SoftPlus.c
+++ b/generic/SoftPlus.c
@@ -10,7 +10,7 @@ static int nn_(SoftPlus_updateOutput)(lua_State *L)
THTensor_(resizeAs)(output, input);
TH_TENSOR_APPLY2(real, output, real, input, \
- *output_data = log1p(exp(*input_data));)
+ *output_data = THLog1p(exp(*input_data));)
return 1;
}