Skip to content

Commit

Permalink
Merge pull request #9 from bbopt/develop
Browse files Browse the repository at this point in the history
Beta 2
  • Loading branch information
montplaisir committed Dec 1, 2020
2 parents 3297047 + 4ba6030 commit d985bba
Show file tree
Hide file tree
Showing 925 changed files with 53,005 additions and 32,341 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
XCode/
*.vscode
VisualStudio/**
build/
builds/
dev_tests/*.txt
examples/**/*.exe
examples/**/cache.txt
src/*.txt
src/nbproject/
*.swp
src/Attribute/*.hpp
135 changes: 135 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# ----------------------------------------------------------------------------
# Root CMake file for Nomad
# ----------------------------------------------------------------------------

# cmake version : the latest one
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

# name of the project
project (Nomad VERSION 4.0.0)

# use standard compilers parameters for c++14
SET(CMAKE_CXX_STANDARD 14 )
SET(CMAKE_CXX_STANDARD_REQUIRED ON )

# Disable in-source builds to prevent source tree corruption.
if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "FATAL: In-source builds are not allowed.
You should create a separate directory for build files.
")
endif()

#check compiler version
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# require at least gcc 4
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8)
message(FATAL_ERROR "GCC version < 8 has not been tested for Nomad!")
endif()
elseif (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
# require at least clang 5
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
message(FATAL_ERROR "Clang version has not been tested for Nomad!")
endif()
else()
message(WARNING "You are using an unsupported compiler! Compilation has only been tested with Clang and GCC.")
endif()

#options


# Load some modules
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)

# special flag required
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

#
# Message for starting configuration
#
message(CHECK_START " Configuring custom options")
list(APPEND CMAKE_MESSAGE_INDENT " ")

#
# Modify the install prefix if not specified on the command
#
set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR} CACHE PATH "..." FORCE)
message(STATUS " Installation prefix set to ${CMAKE_INSTALL_PREFIX}")

#
# Use sgtelib
#
set(USE_SGTELIB ON)
if(USE_SGTELIB MATCHES ON)
message(CHECK_START " Configuring for use of Sgtelib library")

if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/ext/sgtelib)
message(CHECK_FAIL " failed. Directory ${CMAKE_CURRENT_SOURCE_DIR}/ext/sgtelib not found. Let's configure without Sgtelib library")
set(USE_SGTELIB OFF)
else()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext)
add_compile_definitions(USE_SGTELIB)
list(APPEND EXTRA_LIBS sgtelib)
message(CHECK_PASS " Sgtelib found. done")
endif()
else()
message(STATUS " Sgtelib library will NOT be used\n")
endif()

#
# Choose to build with time stats enabled
#
option(TIME_STATS "Option to build with time stats enabled" OFF)
if(TIME_STATS MATCHES ON)
message(CHECK_START " Enabling time stats for build")
add_compile_definitions(TIME_STATS)
endif()

#
# Choose to build the examples/tests using library mode or not
#
option(BUILD_LIBMODE_EXAMPLES "Option to build library mode examples" ON)
if(BUILD_LIBMODE_EXAMPLES MATCHES ON)
message(CHECK_START " Configuring build for library mode examples and tests")

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/examples)
message(CHECK_PASS " done")
else()
message(STATUS " Examples/tests NOT built")
endif()

#
# Choose to build the interface
#
option(BUILD_INTERFACES "Option to build interfaces to Nomad" OFF)
if(BUILD_INTERFACES MATCHES ON)
message(CHECK_START " Configuring build for interfaces")

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/interfaces)
message(CHECK_PASS " done")
else()
message(STATUS " Interfaces to Nomad NOT built")
endif()

#
# Test openMP package
#
find_package(OpenMP QUIET)
if(OpenMP_FOUND)
message(STATUS " Test OpenMP for parallel functionalities -- found ")
else()
message(STATUS " OpenMP not found. Parallel functionalities NOT available")
endif()

#
# Custom options final message
#
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(CHECK_PASS " done")

#
# Add nomad app directory for building
#
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)

1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ Romain Couderc
Miguel Diago Martinez
Solène Kojtych
Guillaume Lameynardie
Alexis Montoison
Caroline Rocha
Ludovic Salomon
79 changes: 49 additions & 30 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
# Christophe Tribes - Polytechnique Montreal #
# #
# The copyright of NOMAD - version 4.0.0 is owned by #
# Charles Audet - Polytechnique Montreal #
# Sebastien Le Digabel - Polytechnique Montreal #
# Viviane Rochon Montplaisir - Polytechnique Montreal #
# Christophe Tribes - Polytechnique Montreal #
# #
# NOMAD v4 has been funded by Rio Tinto, Hydro-Québec, NSERC (Natural Science #
# and Engineering Research Council of Canada), INOVEE (Innovation en Energie #
# Electrique and IVADO (The Institute for Data Valorization) #
# NOMAD v4 has been funded by Rio Tinto, Hydro-Québec, NSERC (Natural #
# Sciences and Engineering Research Council of Canada), InnovÉÉ (Innovation #
# en Énergie Électrique) and IVADO (The Institute for Data Valorization) #
# #
# NOMAD v3 was created and developed by Charles Audet, Sebastien Le Digabel, #
# Christophe Tribes and Viviane Rochon Montplaisir and was funded by AFOSR #
Expand All @@ -30,8 +31,6 @@
# Polytechnique Montreal - GERAD #
# C.P. 6079, Succ. Centre-ville, Montreal (Quebec) H3C 3A7 Canada #
# e-mail: nomad@gerad.ca #
# phone : 1-514-340-6053 #6928 #
# fax : 1-514-340-5665 #
# #
# This program is free software: you can redistribute it and/or modify it #
# under the terms of the GNU Lesser General Public License as published by #
Expand All @@ -49,13 +48,13 @@
# You can find information on the NOMAD software at www.gerad.ca/nomad #
#---------------------------------------------------------------------------------#

DISCLAIMER :
DISCLAIMER:

This is a Beta version of NOMAD 4.0.0. It represents work in progress and
subject to change without notice.


DESCRIPTION :
DESCRIPTION:

NOMAD is a C++ implementation of the Mesh Adaptive Direct Search (MADS)
algorithm, designed for constrained optimization of black-box functions.
Expand All @@ -65,53 +64,73 @@ The algorithms implemented are based on the book
Springer 2017.


WEB PAGE :
WEB PAGE:

https://www.gerad.ca/nomad/


CONTACT :
CONTACT:

nomad@gerad.ca


USAGE :
COMPILATION (Release):

NOMAD 4 usage is similar to NOMAD 3, including batch and library modes.
On Linux, Unix, and Mac OS X, NOMAD can be compiled using CMake.
The minimum version of CMake is 3.14. Older versions will trigger
an error. A recent C++ compiler is also required.

The procedure is the following. On the command line in the
$NOMAD_HOME directory:

COMPILATION :
cmake -S . -B build/release ---> Create the CMake files and directories for
building (-B) in build/release.
The source (-S) CMakeLists.txt file is in
the $NOMAD_HOME directory.
To enable time stats build:
cmake -DTIME_STATS=ON -S . -B build/release

On Linux, Unix, and Mac OS X, NOMAD can be compiled using the makefile
located in the "src" directory.

Make options for Nomad 4:
cmake --build build/release ---> Build the libraries and applications
Option --parallel xx can be added for faster
build

If OpenMP is not available:
make NOOMP=1
cmake --install build/release ---> Copy binaries and headers in
build/release/[bin, include, lib]
and in the examples/tests directories

To compile without using sgtelib:
make USE_SGTELIB=0
The executable "nomad" will installed into the directory:
build/release/bin/ (build/debug/bin/ when in debug mode).

To compile in Debug mode:
make VARIANT=debug

The executable "nomad" will be produced to directory:
build/release/bin/ (build/debug/bin/ when in debug mode).
COMPILATION (Debug):

The procedure to build the debug version is the following.
On the command line in the $NOMAD_HOME directory:

cmake -S . -B build/debug -D CMAKE_BUILD_TYPE=Debug

cmake --build build/debug ---> Build the libraries and applications
Option --parallel xx can be added for faster
build

cmake --install build/debug ---> Copy binaries and headers in
build/debug/[bin, include, lib]
and in the examples/tests directories


EXAMPLES :
EXAMPLES OF OPTIMIZATION:

Batch Mode:
There are examples in batch mode in examples/basic/batch/.
In each directory, the blackbox (usually named bb.exe) may be compiled using the
provided makefile.
The problem may be resolved using NOMAD and the parameter file param.txt:
In each directory, the blackbox (usually named bb.exe) may be compiled using
the provided makefile.
The problem may be resolved using NOMAD and the parameter file:
nomad param.txt

Library Mode:
There are examples in library mode in examples/basic/library/.
In each directory, the executable may be compiled using the provided makefile
(using the same flags as for the NOMAD compilation). The problems may be resolved
by execution, for instance:
In each directory, the executable may be compiled when building
Nomad application. The problems may be resolved by execution,
for instance:
example_lib.exe
1 change: 1 addition & 0 deletions doc/doxygen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
html

0 comments on commit d985bba

Please sign in to comment.