Skip to content

Commit

Permalink
Adding premake file for build.
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo-X committed May 21, 2016
1 parent f6d1b97 commit 17c5e85
Show file tree
Hide file tree
Showing 3 changed files with 310 additions and 6 deletions.
24 changes: 24 additions & 0 deletions args/dog_slopes_mixed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-scenario= poli_eval

-character_file= data/characters/dog.txt
-motion_file= data/motions/dog_bound.txt
-state_file= data/states/dog_bound_state.txt

-output_path= output/dog_model.h5

-char_type= dog
-char_ctrl= dog_mace
-terrain_file= data/terrain/slopes_mixed.txt
-cam_track_mode= x

-num_update_steps= 20
-num_sim_substeps= 5
-world_scale= 4

-char_init_pos_x= 1.2
-landing_target_step_x= 1.1
-landing_target_offset_x= 1.3

-policy_solver= data/policies/dog/nets/dog_mace3_solver.prototxt
-policy_net= data/policies/dog/nets/dog_mace3_deploy.prototxt
-policy_model= data/policies/dog/models/dog_mace3_slopes_mixed_model.h5
7 changes: 1 addition & 6 deletions learning/NeuralNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
#include "NNSolver.h"
#include "AsyncSolver.h"

#ifdef _LINUX_
#include <caffe_backup/data_layers.hpp>
#include <caffe/sgd_solvers.hpp>
#endif

const std::string gInputOffsetKey = "InputOffset";
const std::string gInputScaleKey = "InputScale";
const std::string gOutputOffsetKey = "OutputOffset";
Expand Down Expand Up @@ -1237,4 +1232,4 @@ int cNeuralNet::cCaffeNetWrapper::GetLayerIdx(const std::string& layer_name) con
{
int idx = layer_names_index_.find(layer_name)->second;
return idx;
}
}
285 changes: 285 additions & 0 deletions premake4.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
--
-- premake4 file to build TerrainRL
-- Copyright (c) 2009-2015 Glen Berseth
-- See license.txt for complete license.
--

local action = _ACTION or ""
local todir = "./" .. action

function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end

local linuxLibraryLoc = "./external/"
local windowsLibraryLoc = "../library/"

solution "TerrainRL"
configurations {
"Debug",
"Release"
}

platforms {
"x32",
"x64"
}
-- location (todir)

-- extra warnings, no exceptions or rtti
flags {
"ExtraWarnings",
-- "FloatFast",
-- "NoExceptions",
-- "NoRTTI",
"Symbols"
}
-- defines { "ENABLE_GUI", "ENABLE_GLFW" }

-- debug configs
configuration "Debug*"
defines { "DEBUG" }
flags {
"Symbols",
Optimize = Off
}

-- release configs
configuration "Release*"
defines { "NDEBUG" }
flags { "Optimize" }

-- windows specific
configuration "windows"
defines { "WIN32", "_WINDOWS" }
libdirs { "lib" }
targetdir ( "./" )

configuration { "linux" }
linkoptions {
-- "-stdlib=libc++" ,
"-Wl,-rpath," .. path.getabsolute("lib")
}
targetdir ( "./" )

configuration { "macosx" }
buildoptions { "-stdlib=libc++ -std=c++11 -ggdb" }
linkoptions {
"-stdlib=libc++" ,
"-Wl,-rpath," .. path.getabsolute("lib")
}
links {
"OpenGL.framework",
}
targetdir ( "./" )

if os.get() == "macosx" then
premake.gcc.cc = "clang"
premake.gcc.cxx = "clang++"
-- buildoptions("-std=c++0x -ggdb -stdlib=libc++" )
end


project "TerrainRL"
language "C++"
kind "WindowedApp"

files {
-- Source files for this project
"learning/*.h",
"learning/*.cpp",
"render/*.h",
"render/*.cpp",
"scenarios/*.h",
"scenarios/*.cpp",
"sim/*.h",
"sim/*.cpp",
"util/*.h",
"util/*.cpp",
"anim/*.h",
"anim/*.cpp",
"external/LodePNG/*.cpp",
"Main.cpp"
}
excludes
{
"learning/DMACETrainer - Copy.cpp"
}
includedirs {
"./",
}



defines {
"_DEBUG",
"_CRT_SECURE_NO_WARNINGS",
"_SCL_SECURE_NO_WARNINGS",
"CPU_ONLY",
"GOOGLE_GLOG_DLL_DECL=",
"ENABLE_TRAINING",
"ENABLE_DEBUG_PRINT",
"ENABLE_DEBUG_VISUALIZATION",
}

targetdir "./"
buildoptions("-std=c++0x -ggdb" )

-- linux library cflags and libs
configuration { "linux", "gmake" }
buildoptions {
"`pkg-config --cflags gl`",
"`pkg-config --cflags glu`"
}
linkoptions {
"-Wl,-rpath," .. path.getabsolute("lib") ,
"`pkg-config --libs gl`",
"`pkg-config --libs glu`"
}
libdirs {
-- "lib",
linuxLibraryLoc .. "Bullet/bin",
linuxLibraryLoc .. "jsoncpp/build/debug/src/lib_json",
linuxLibraryLoc .. "caffe/build/lib",
}

includedirs {
linuxLibraryLoc .. "Bullet/src",
linuxLibraryLoc,
linuxLibraryLoc .. "jsoncpp/include",
linuxLibraryLoc .. "caffe/include/",
linuxLibraryLoc .. "caffe/build/src/",
"C:/Program Files (x86)/boost/boost_1_58_0/",
linuxLibraryLoc .. "3rdparty/include/hdf5",
linuxLibraryLoc .. "3rdparty/include/",
linuxLibraryLoc .. "3rdparty/include/openblas",
linuxLibraryLoc .. "3rdparty/include/lmdb",
"/usr/local/cuda/include/",
linuxLibraryLoc .. "OpenCV/include",
linuxLibraryLoc .. "caffe/src/",
}
defines {
"_LINUX_",
}
-- debug configs
configuration "Debug*"
links {
"X11",
"dl",
"pthread",
-- Just a few dependancies....
"BulletDynamics_gmake_x64_debug",
"BulletCollision_gmake_x64_debug",
"LinearMath_gmake_x64_debug",
"jsoncpp",
"boost_system",
"caffe",
"glog",
"hdf5",
"hdf5_hl",
"glut",
"GLEW",
}

-- release configs
configuration "Release*"
defines { "NDEBUG" }
links {
"X11",
"dl",
"pthread",
-- Just a few dependancies....
"BulletDynamics_gmake_x64_release",
"BulletCollision_gmake_x64_release",
"LinearMath_gmake_x64_release",
"jsoncpp",
"boost_system",
"caffe",
"glog",
"hdf5",
"hdf5_hl",
"glut",
"GLEW",
}

-- windows library cflags and libs
configuration { "windows" }
-- libdirs { "lib" }
includedirs {
windowsLibraryLoc .. "Bullet/include",
windowsLibraryLoc,
windowsLibraryLoc .. "Json_cpp",
windowsLibraryLoc .. "caffe/include/",
"C:/Program Files (x86)/boost/boost_1_58_0/",
windowsLibraryLoc .. "caffe/3rdparty/include/hdf5",
windowsLibraryLoc .. "caffe/3rdparty/include/",
windowsLibraryLoc .. "caffe/3rdparty/include/openblas",
windowsLibraryLoc .. "caffe/3rdparty/include/lmdb",
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.5/include/",
windowsLibraryLoc .. "OpenCV/include",
windowsLibraryLoc .. "caffe/src/",
}
links {
"opengl32",
"glu32",
-- Just a few dependancies....
"BulletDynamics_Debug",
"BulletCollision_Debug",
"LinearMath_Debug",
"jsoncpp_Debug",
"opencv_core300d",
"opencv_calib3d300d",
"opencv_flann300d",
"opencv_highgui300d",
"opencv_imgproc300d",
"opencv_imgcodecs300d",
"opencv_ml300d",
"opencv_objdetect300d",
"opencv_photo300d",
"opencv_features2d300d",
"opencv_stitching300d",
"opencv_video300d",
"opencv_videostab300d",
"opencv_hal300d",
"libjpegd",
"libjasperd",
"libpngd",
"IlmImfd",
"libtiffd",
"libwebpd",
"cudart",
"cuda",
"nppi",
"cufft",
"cublas",
"curand",
"gflagsd",
"libglogd",
"libprotobufd",
"libprotocd",
"leveldbd",
"lmdbd",
"libhdf5_D",
"libhdf5_hl_D",
"Shlwapi",
"zlibd",
"libopenblas"
}

-- mac includes and libs
configuration { "macosx" }
kind "ConsoleApp" -- xcode4 failes to run the project if using WindowedApp
-- includedirs { "/Library/Frameworks/SDL.framework/Headers" }
buildoptions { "-Wunused-value -Wshadow -Wreorder -Wsign-compare -Wall" }
linkoptions {
"-Wl,-rpath," .. path.getabsolute("lib") ,
}
links {
"OpenGL.framework",
"Cocoa.framework",
"dl",
"pthread"
}

include "optimizer/"

0 comments on commit 17c5e85

Please sign in to comment.