Skip to content

Commit

Permalink
updatded submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
ebertolazzi committed Nov 10, 2021
1 parent da0a5c1 commit 7d08b7d
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 110 deletions.
62 changes: 0 additions & 62 deletions .travis.yml

This file was deleted.

20 changes: 10 additions & 10 deletions CMakeLists-cflags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ SET( CMAKE_VERBOSE_MAKEFILE TRUE )
# /Gv Uses the __vectorcall calling convention. (x86 and x64 only)
# /Gz Uses the __stdcall calling convention (x86 only).

SET( CXX_WARN "-Wall -Wno-float-equal -Wno-padded -Wno-comment ")
SET( CXX_WARN "-Wall -Wno-float-equal -Wno-padded ")
SET( CLANG_WARN "-Weverything -Wno-alloca -Wno-cast-align -Wno-cast-qual -Wno-conversion -Wno-c++2a-compat -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-implicit-fallthrough -Wno-documentation -Wno-float-equal -Wno-padded -Wno-reserved-id-macro -Wno-unreachable-code-break -Wno-unused-macros -Wno-switch-enum -Wno-sign-conversion -Wno-signed-enum-bitfield -Wno-weak-vtables ")
SET( VS_WARN "")

IF( CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
SET( CMAKE_CXX_FLAGS "-std=c++11 ${CXX_WARN}" )
SET( CMAKE_CXX_FLAGS_RELEASE "-fPIC -fopenmp -O2 -g -floop-interchange -floop-block -funroll-loops " )
SET( CMAKE_CXX_FLAGS_DEBUG "-fPIC -fopenmp -O0 -ggdb -DMECHATRONIX_DEBUG -DDEBUG " )
SET( CMAKE_CXX_FLAGS "-std=c++11 " )
SET( CMAKE_CXX_FLAGS_RELEASE "-fPIC -fopenmp -O2 -g -floop-interchange -floop-block -funroll-loops ${CXX_WARN}" )
SET( CMAKE_CXX_FLAGS_DEBUG "-fPIC -fopenmp -O0 -ggdb -DMECHATRONIX_DEBUG -DDEBUG ${CXX_WARN}" )
ELSEIF( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
SET( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CLANG_WARN}" )
SET( CMAKE_CXX_FLAGS_RELEASE "-fPIC -Os -g -finline-functions -finline-hint-functions -funroll-loops -fcolor-diagnostics " )
SET( CMAKE_CXX_FLAGS_DEBUG "-fPIC -O0 -gfull -fcolor-diagnostics -DMECHATRONIX_DEBUG -DDEBUG " )
SET( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ " )
SET( CMAKE_CXX_FLAGS_RELEASE "-fPIC -Os -g -finline-functions -finline-hint-functions -funroll-loops -fcolor-diagnostics ${CLANG_WARN}" )
SET( CMAKE_CXX_FLAGS_DEBUG "-fPIC -O0 -gfull -fcolor-diagnostics -DMECHATRONIX_DEBUG -DDEBUG ${CLANG_WARN}" )
ELSEIF( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
SET( CMAKE_CXX_FLAGS " ${VS_WARN}" )
SET( CMAKE_CXX_FLAGS_RELEASE "/nologo /GS /W3 /WX- /EHsc /bigobj /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS /DHAVE_STRING_H /DNO_GETTIMEOFDAY /DYAML_DECLARE_STATIC /DPCRE_STATIC /O2 /MD " )
SET( CMAKE_CXX_FLAGS_DEBUG "/nologo /GS /W3 /WX- /EHsc /bigobj /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS /DHAVE_STRING_H /DNO_GETTIMEOFDAY /DYAML_DECLARE_STATIC /DPCRE_STATIC /Od /Ob0 /MDd /RTC1 /guard:cf /Zi /D_DEBUG /DMECHATRONIX_DEBUG " )
SET( CMAKE_CXX_FLAGS "" )
SET( CMAKE_CXX_FLAGS_RELEASE "/nologo /GS /W3 /WX- /EHsc /bigobj /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS /DHAVE_STRING_H /DNO_GETTIMEOFDAY /DYAML_DECLARE_STATIC /DPCRE_STATIC /O2 /MD ${VS_WARN}" )
SET( CMAKE_CXX_FLAGS_DEBUG "/nologo /GS /W3 /WX- /EHsc /bigobj /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS /DHAVE_STRING_H /DNO_GETTIMEOFDAY /DYAML_DECLARE_STATIC /DPCRE_STATIC /Od /Ob0 /MDd /RTC1 /guard:cf /Zi /D_DEBUG /DMECHATRONIX_DEBUG ${VS_WARN}" )
ELSE()
MESSAGE( FATAL_ERROR "Unsupported compiler ${CMAKE_CXX_COMPILER_ID}")
ENDIF()
Expand Down
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,23 @@ endif()
# DEPENDENCIES (TRY TO USE ALREADY COMPILED SUBMODULE IN LARGE PROJECT)
set(UPDIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
set(DEPEND_TARGETS)
find_library( UTILS Utils${ARTIFACTS_STATIC_SUFFIX} HINTS ${UPDIR}/Utils/lib/lib )
find_library(
UTILS Utils${ARTIFACTS_STATIC_SUFFIX}
HINTS ${UPDIR}/Utils/lib/lib
NO_DEFAULT_PATH
)
if( UTILS )
include_directories(${UPDIR}/Utils/lib/include)
else()
add_subdirectory(./submodules/Utils)
set( UTILS UtilsStatic )
set( DEPEND_TARGETS ${DEPEND_TARGETS} UtilsStatic )
endif()
find_library( QUARTIC quartic${ARTIFACTS_STATIC_SUFFIX} HINTS ${UPDIR}/quarticRootsFlocke/lib/lib )
find_library(
QUARTIC quartic${ARTIFACTS_STATIC_SUFFIX}
HINTS ${UPDIR}/quarticRootsFlocke/lib/lib
NO_DEFAULT_PATH
)
if( QUARTIC )
include_directories(${UPDIR}/quarticRootsFlocke/lib/include)
else()
Expand Down
53 changes: 31 additions & 22 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
end
end

case RUBY_PLATFORM
when /darwin/
OS = :mac
when /linux/
OS = :linux
when /cygwin|mswin|mingw|bccwin|wince|emx/
OS = :win
end

require_relative "./Rakefile_common.rb"

file_base = File.expand_path(File.dirname(__FILE__)).to_s+'/lib'
Expand All @@ -29,6 +38,9 @@ else
end
cmd_cmake_build += " -DINSTALL_HERE:VAR=true "

desc "default task --> build"
task :default => :build

FileUtils.cp 'CMakeLists-cflags.txt', 'submodules/Utils/CMakeLists-cflags.txt'
FileUtils.cp 'CMakeLists-cflags.txt', 'submodules/quarticRootsFlocke/CMakeLists-cflags.txt'

Expand All @@ -50,14 +62,14 @@ TESTS = [
"run tests on linux/osx"
task :run do
TESTS.each do |cmd|
sh "./bin/#{cmd}"
sh "./bin/#{cmd}" if File.exist?( "./bin/#{cmd}" )
end
end

desc "run tests (Release) on windows"
task :run_win do
TESTS.each do |cmd|
sh "bin\\Release\\#{cmd}.exe"
sh "bin\\Release\\#{cmd}.exe" if File.exist?( "bin\\Release\\#{cmd}.exe" )
end
end

Expand All @@ -68,6 +80,19 @@ task :run_win_debug do
end
end

desc "build lib"
task :build do
puts "UTILS build".green
case OS
when :mac
Rake::Task[:build_osx].invoke
when :linux
Rake::Task[:build_linux].invoke
when :win
Rake::Task[:build_win].invoke
end
end

desc "compile for Visual Studio [default year=2017, bits=x64]"
task :build_win, [:year, :bits] do |t, args|

Expand Down Expand Up @@ -96,9 +121,7 @@ task :build_win, [:year, :bits] do |t, args|
end

desc "compile for OSX"
task :build, [:os] do |t, args|

args.with_defaults( :os => "osx" )
task :build_osx do

dir = "build"

Expand All @@ -121,26 +144,12 @@ task :build, [:os] do |t, args|
end

desc "compile for LINUX"
task :build_linux do
Rake::Task[:build].invoke("linux")
end

desc "compile for OSX"
task :build_osx do
Rake::Task[:build].invoke("osx")
end
task :build_linux => :build_osx

task :clean_osx do
FileUtils.rm_rf 'lib'
FileUtils.rm_rf 'lib3rd'
end

task :clean_linux do
FileUtils.rm_rf 'lib'
FileUtils.rm_rf 'lib3rd'
end

task :clean_win do
FileUtils.rm_rf 'lib'
FileUtils.rm_rf 'lib3rd'
end
task :clean_linux => :clean_osx
task :clean_win => :clean_osx
11 changes: 0 additions & 11 deletions Rakefile_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@

require_relative "./Rakefile_conf.rb"

if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil then
#linux
task :default => [:install_linux]
elsif (/darwin/ =~ RUBY_PLATFORM) != nil then
#osx
task :default => [:install_osx]
else
#windows
task :default => [:install_windows]
end

#
# https://stackoverflow.com/questions/6934185/ruby-net-http-following-redirects/6934503
#
Expand Down
2 changes: 1 addition & 1 deletion Rakefile_conf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
else
COMPILE_DEBUG = false
COMPILE_DYNAMIC = false
COMPILE_EXECUTABLE = false
COMPILE_EXECUTABLE = trues
USE_NMAKE = true

case RUBY_PLATFORM
Expand Down
2 changes: 1 addition & 1 deletion submodules/Utils
2 changes: 1 addition & 1 deletion submodules/quarticRootsFlocke

0 comments on commit 7d08b7d

Please sign in to comment.