diff --git a/.gitignore b/.gitignore index 7321e5b..cb5c914 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ Source/pyEMsoft/docs/_template/ Source/pyEMsoft/docs/_static/ Source/pyEMsoft/docs/_build/ +Workspace /EMSphInx/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 0ce5edc..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "EMsoft"] - path = EMsoft - url = https://github.com/emsoft-org/EMsoft -[submodule "EMsoftData"] - path = EMsoftData - url = https://github.com/emsoft-org/EMsoftData diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..437d5a4 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,65 @@ +cmake_minimum_required(VERSION 3.14.0) + +project(EMsoftCI VERSION 2.0.0.0 LANGUAGES NONE) + +include(ExternalProject) + +set(EMsoft_WORKSPACE ${EMsoftCI_SOURCE_DIR}/Workspace CACHE PATH "Root directory where repos will be cloned") + +include(${PROJECT_SOURCE_DIR}/Repos.cmake) + +#------------------------------------------------------------------------------ +# Function to clone the repository using ExternalProject_Add +#------------------------------------------------------------------------------ +function(CloneRepo) + set(options) + set(oneValueArgs NAME ROOT_DIR GIT_REPO GIT_TAG) + set(multiValueArgs) + cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + set(CLONE_DIR ${ARGS_ROOT_DIR}/${ARGS_NAME}) + + message(STATUS "Cloning \"${ARGS_GIT_REPO}\" at tag \"${ARGS_GIT_TAG}\" in \"${CLONE_DIR}\"" ) + ExternalProject_Add(${ARGS_NAME} + GIT_REPOSITORY ${ARGS_GIT_REPO} + GIT_TAG ${ARGS_GIT_TAG} + GIT_PROGRESS ON + + SOURCE_DIR ${CLONE_DIR} + + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" + + TMP_DIR ${PROJECT_BINARY_DIR}/${ARGS_NAME}/temp + STAMP_DIR ${PROJECT_BINARY_DIR}/${ARGS_NAME}/stamp + DOWNLOAD_DIR ${PROJECT_BINARY_DIR}/${ARGS_NAME}/download + BINARY_DIR ${PROJECT_BINARY_DIR}/${ARGS_NAME}/binary + INSTALL_DIR ${PROJECT_BINARY_DIR}/${ARGS_NAME}/install + + LOG_DOWNLOAD ON + LOG_UPDATE ON + LOG_CONFIGURE ON + LOG_BUILD ON + LOG_TEST ON + LOG_INSTALL ON + ) +endfunction() + +if("${EMsoft_WORKSPACE}" STREQUAL "") + message(FATAL_ERROR "EMsoft_WORKSPACE is empty. Cloning DREAM.3D can not continue. \ + Please set the -DEMsoft_WORKSPACE=/Path/to/Directory/of/EMsoft to the directory where you want to clone all the EMsoft \ + repositories. Anything in that directory may be over written.") +endif() + +foreach(plugin ${EMsoft_Base_Repos}) + CloneRepo(NAME ${plugin} + GIT_REPO "${${plugin}_BASE_URL}/${${plugin}_GH_ORG}/${${plugin}_REPO_NAME}.git" + GIT_TAG "${${plugin}_GIT_BRANCH}" + ROOT_DIR "${EMsoft_WORKSPACE}" + ) +endforeach() + diff --git a/EMsoft b/EMsoft deleted file mode 160000 index cc8e5f7..0000000 --- a/EMsoft +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cc8e5f71425d856a0cc13d9ff92a1618076365a3 diff --git a/EMsoftData b/EMsoftData deleted file mode 160000 index 7549126..0000000 --- a/EMsoftData +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7549126266429e32188969319c3676ca5f9f59c3 diff --git a/Repos.cmake b/Repos.cmake new file mode 100644 index 0000000..94258fc --- /dev/null +++ b/Repos.cmake @@ -0,0 +1,20 @@ +set(EMsoft_Base_Repos + EMsoft + EMsoftData +) + +#-------------------------------------------------------------------------------------------------- +# EMsoft Details +#-------------------------------------------------------------------------------------------------- +set(EMsoft_REPO_NAME "EMsoft") +set(EMsoft_BASE_URL "https://www.github.com") +set(EMsoft_GH_ORG "emsoft-org") +set(EMsoft_GIT_BRANCH "develop") + +#-------------------------------------------------------------------------------------------------- +# EMsoftData Details +#-------------------------------------------------------------------------------------------------- +set(EMsoftData_REPO_NAME "EMsoftData") +set(EMsoftData_BASE_URL "https://www.github.com") +set(EMsoftData_GH_ORG "emsoft-org") +set(EMsoftData_GIT_BRANCH "develop") diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 55dc3ae..deaf48c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,21 +28,36 @@ stages: echo BUILDNAME=$(Agent.OS)-$(Agent.MachineName)-$(Build.SourceBranchName)_$(Build.BuildNumber) echo Build.BuildNumber=$(Build.BuildNumber) displayName: 'Dump Azure Variables' + - script: | + cd $(Build.Repository.LocalPath) + $(Agent.WorkFolder)/../cmake-3.16.6-Darwin-x86_64/CMake.app/Contents/bin/cmake -G Ninja -S $(Build.Repository.LocalPath) -B $(Build.Repository.LocalPath)/Build + $(Agent.WorkFolder)/../cmake-3.16.6-Darwin-x86_64/CMake.app/Contents/bin/cmake --build $(Build.Repository.LocalPath)/Build + displayName: 'Clone Repositories' + - script: | + cd $(Build.BinariesDirectory) + if [ -f "CMakeCache.txt" ]; then + rm CMakeCache.txt + fi + if [ -d "Bin" ]; then + rm -rf Bin + fi + displayName: 'Clean Build Directory' - script: | cd $(Build.BinariesDirectory) - cmake -G "Unix Makefiles" -DEMsoft_SDK=$(Agent.WorkFolder) -DEMsoftData_DIR=$(Build.Repository.LocalPath)/EMsoftData -DCMAKE_BUILD_TYPE=Release -DBUILDNAME="$(Agent.MachineName)-$(Agent.OS)-$(Build.SourceBranchName)_$(Build.BuildNumber)" $(Build.Repository.LocalPath)/EMsoft + $(Agent.WorkFolder)/../cmake-3.16.6-Darwin-x86_64/CMake.app/Contents/bin/cmake -G "Unix Makefiles" -DEMsoft_SDK=$(Agent.WorkFolder) -DEMsoftData_DIR=$(Build.Repository.LocalPath)/Workspace/EMsoftData -DCMAKE_BUILD_TYPE=Release -DBUILDNAME="$(Agent.MachineName)-$(Agent.OS)-$(Build.SourceBranchName)_$(Build.BuildNumber)" $(Build.Repository.LocalPath)/Workspace/EMsoft displayName: 'Configure EMsoft' - script: | cd $(Build.BinariesDirectory) - cmake --build . --config Release --target all --parallel 12 + $(Agent.WorkFolder)/../cmake-3.16.6-Darwin-x86_64/CMake.app/Contents/bin/cmake --build . --config Release --target all displayName: 'Compile EMsoft' - script: | cd $(Build.BinariesDirectory) - ctest -D Experimental --timeout 7200 -DCTEST_SITE=$(Agent.MachineName).bluequartz.net -Ddashboard_source_name=EMsoft + export EMSOFTPATHNAME="$(Build.Repository.LocalPath)/Workspace/EMsoft" + $(Agent.WorkFolder)/../cmake-3.16.6-Darwin-x86_64/CMake.app/Contents/bin/ctest -D Experimental --timeout 7200 -DCTEST_SITE=$(Agent.MachineName).bluequartz.net -Ddashboard_source_name=EMsoft displayName: 'Testing EMsoft' - script: | cd $(Build.BinariesDirectory) - cpack --verbose + $(Agent.WorkFolder)/../cmake-3.16.6-Darwin-x86_64/CMake.app/Contents/bin/cpack --verbose displayName: 'Packing EMsoft' - job: Windows_10_19_03 timeoutInMinutes: 120 @@ -67,9 +82,14 @@ stages: echo BUILDNAME=$(Agent.OS)-$(Agent.MachineName)-$(Build.SourceBranchName)_$(Build.BuildNumber) echo Build.BuildNumber=$(Build.BuildNumber) displayName: 'Dump Azure Variables' + - script: | + cd $(Build.Repository.LocalPath) + $(Agent.WorkFolder)\..\cmake-3.16.2-win64-x64\bin\cmake.exe -G "NMake Makefiles" -S $(Build.Repository.LocalPath) -B $(Build.Repository.LocalPath)/Build + $(Agent.WorkFolder)\..\cmake-3.16.2-win64-x64\bin\cmake.exe --build $(Build.Repository.LocalPath)/Build + displayName: 'Clone Repositories' - script: | cd $(Build.BinariesDirectory) - $(Agent.WorkFolder)\..\cmake-3.16.2-win64-x64\bin\cmake.exe -G "NMake Makefiles" -DEMsoft_SDK=$(Agent.WorkFolder) -DEMsoftData_DIR=$(Build.Repository.LocalPath)/EMsoftData -DBUILDNAME="$(Agent.MachineName)-$(Agent.OS)-$(Build.SourceBranchName)_$(Build.BuildNumber)" -DCMAKE_BUILD_TYPE=Release $(Build.Repository.LocalPath)/EMsoft + $(Agent.WorkFolder)\..\cmake-3.16.2-win64-x64\bin\cmake.exe -G "NMake Makefiles" -DEMsoft_SDK=$(Agent.WorkFolder) -DEMsoftData_DIR=$(Build.Repository.LocalPath)/Workspace/EMsoftData -DBUILDNAME="$(Agent.MachineName)-$(Agent.OS)-$(Build.SourceBranchName)_$(Build.BuildNumber)" -DCMAKE_BUILD_TYPE=Release $(Build.Repository.LocalPath)/Workspace/EMsoft displayName: 'Configure EMsoft' - script: | cd $(Build.BinariesDirectory) @@ -106,23 +126,28 @@ stages: echo BUILDNAME=$(Agent.OS)-$(Agent.MachineName)-$(Build.SourceBranchName)_$(Build.BuildNumber) echo Build.BuildNumber=$(Build.BuildNumber) displayName: 'Dump Azure Variables' + - script: | + cd $(Build.Repository.LocalPath) + $(Agent.WorkFolder)/../cmake-3.16.6-Linux-x86_64/bin/cmake -S $(Build.Repository.LocalPath) -B $(Build.Repository.LocalPath)/Build + $(Agent.WorkFolder)/../cmake-3.16.6-Linux-x86_64/bin/cmake --build $(Build.Repository.LocalPath)/Build + displayName: 'Clone Repositories' - script: | cd $(Build.BinariesDirectory) - export CXX=/usr/bin/g++-7 - export CC=/usr/bin/gcc-7 - export FC=/usr/bin/gfortran-7 - $(Agent.WorkFolder)/../cmake-3.16.2-Linux-x86_64/bin/cmake -G "Unix Makefiles" -DEMsoft_SDK=$(Agent.WorkFolder) -DEMsoftData_DIR=$(Build.Repository.LocalPath)/EMsoftData -DCMAKE_BUILD_TYPE=Release -DBUILDNAME="$(Agent.MachineName)-$(Agent.OS)-$(Build.SourceBranchName)_$(Build.BuildNumber)" $(Build.Repository.LocalPath)/EMsoft + export CXX=/usr/bin/g++-8 + export CC=/usr/bin/gcc-8 + export FC=/usr/bin/gfortran-8 + $(Agent.WorkFolder)/../cmake-3.16.6-Linux-x86_64/bin/cmake -G "Unix Makefiles" -DEMsoft_SDK=$(Agent.WorkFolder) -DEMsoftData_DIR=$(Build.Repository.LocalPath)/Workspace/EMsoftData -DCMAKE_BUILD_TYPE=Release -DBUILDNAME="$(Agent.MachineName)-$(Agent.OS)-$(Build.SourceBranchName)_$(Build.BuildNumber)" $(Build.Repository.LocalPath)/Workspace/EMsoft displayName: 'Configure EMsoft' - script: | cd $(Build.BinariesDirectory) - $(Agent.WorkFolder)/../cmake-3.16.2-Linux-x86_64/bin/cmake --build . --config Release --target all --parallel 10 + $(Agent.WorkFolder)/../cmake-3.16.6-Linux-x86_64/bin/cmake --build . --config Release --target all --parallel 10 displayName: 'Compile EMsoft' - script: | cd $(Build.BinariesDirectory) - export EMSOFTPATHNAME=$(Build.Repository.LocalPath)/EMsoft - $(Agent.WorkFolder)/../cmake-3.16.2-Linux-x86_64/bin/ctest -D Experimental --timeout 7200 -DCTEST_SITE=$(Agent.MachineName).bluequartz.net -Ddashboard_source_name=EMsoft + export EMSOFTPATHNAME=$(Build.Repository.LocalPath)/Workspace/EMsoft + $(Agent.WorkFolder)/../cmake-3.16.6-Linux-x86_64/bin/ctest -D Experimental --timeout 7200 -DCTEST_SITE=$(Agent.MachineName).bluequartz.net -Ddashboard_source_name=EMsoft displayName: 'Testing EMsoft' - script: | cd $(Build.BinariesDirectory) - $(Agent.WorkFolder)/../cmake-3.16.2-Linux-x86_64/bin/cpack --verbose + $(Agent.WorkFolder)/../cmake-3.16.6-Linux-x86_64/bin/cpack --verbose displayName: 'Packing EMsoft'