Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Initial dev #1

Merged
merged 108 commits into from
Mar 14, 2023
Merged

Initial dev #1

merged 108 commits into from
Mar 14, 2023

Conversation

ScottBailey
Copy link
Contributor

@ScottBailey ScottBailey commented Jan 26, 2023

This is the initial PR for ANTLER-proj.

See the README.md file to learn what it's all about.

This will: close AntelopeIO/cdt#63, close AntelopeIO/cdt#64, and close AntelopeIO/cdt#65.

@mikelik
Copy link
Member

mikelik commented Jan 27, 2023

Can you add to README current requirements and steps that are needed to compile antler?

If it is missing ninja the error is: CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
Later I found out that at least cmake 3.20 is needed (Because of command cmake_path used).
For previous versions error is CMake Error at aproj/CMakeLists.txt:18 (cmake_path): Unknown CMake command "cmake_path".

My steps were:

mkdir build && cd build
cmake ..
ninja

@mikelik
Copy link
Member

mikelik commented Jan 27, 2023

After first cmake .. if I try to do it again I get:

mikel@msi:~/repo/antler-proj/build$ cmake ..
[ 11%] Performing update step for 'ryml-populate'
[ 22%] Performing patch step for 'ryml-populate'
patching file CMakeLists.txt
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file CMakeLists.txt.rej
patching file ext/c4core/src/c4/substr.hpp
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file ext/c4core/src/c4/substr.hpp.rej
patching file ext/c4core/src/c4/std/string.hpp
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file ext/c4core/src/c4/std/string.hpp.rej
make[2]: *** [CMakeFiles/ryml-populate.dir/build.make:117: ryml-populate-prefix/src/ryml-populate-stamp/ryml-populate-patch] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/ryml-populate.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

CMake Error at /opt/cmake-3.25.2-linux-x86_64/share/cmake-3.25/Modules/FetchContent.cmake:1624 (message):
  Build step for ryml failed: 2
Call Stack (most recent call first):
  /opt/cmake-3.25.2-linux-x86_64/share/cmake-3.25/Modules/FetchContent.cmake:1764:EVAL:2 (__FetchContent_directPopulate)
  /opt/cmake-3.25.2-linux-x86_64/share/cmake-3.25/Modules/FetchContent.cmake:1764 (cmake_language)
  /opt/cmake-3.25.2-linux-x86_64/share/cmake-3.25/Modules/FetchContent.cmake:1978 (FetchContent_Populate)
  depends/rapidyaml.cmake:20 (FetchContent_MakeAvailable)
  depends/CMakeLists.txt:10 (include)


-- Configuring incomplete, errors occurred!
See also "/home/mikel/repo/antler-proj/build/CMakeFiles/CMakeOutput.log".

I have to do following cleanup:

mikel@msi:~/repo/antler-proj/build$ dir=`pwd`
mikel@msi:~/repo/antler-proj/build$ cd /home/mikel/repo/antler-proj/build/_deps/ryml-src/
mikel@msi:~/repo/antler-proj/build/_deps/ryml-src$ git restore CMakeLists.txt
mikel@msi:~/repo/antler-proj/build/_deps/ryml-src$ cd ext/c4core
mikel@msi:~/repo/antler-proj/build/_deps/ryml-src/ext/c4core$ git restore src/c4/substr.hpp
mikel@msi:~/repo/antler-proj/build/_deps/ryml-src/ext/c4core$ git restore src/c4/std/string.hpp
mikel@msi:~/repo/antler-proj/build/_deps/ryml-src/ext/c4core$ cd $dir

and later I can generate cmake again:

mikel@msi:~/repo/antler-proj/build$ cmake ..
-- ryml: using C++ standard: C++17
-- ryml: setting C++ standard: 17
-- ryml: setting C++ standard required: ON
-- ryml: importing subproject c4core (SUBDIRECTORY)... /home/mikel/repo/antler-proj/build/_deps/ryml-src/ext/c4core
-- c4core: using C++ standard: C++17
-- ryml: -----> target ryml PUBLIC incorporating lib c4core
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mikel/repo/antler-proj/build

@mikelik
Copy link
Member

mikelik commented Jan 27, 2023

If I run cmake .. for the first time I think build.ninja file appeared and I could build project with ninja.
If I created new directory build2 and run there cmake .. it did not generate build.ninja. I don't think this is expected?
Content of build2:

mikel@msi:~/repo/antler-proj/build2$ ls -1a
.
..
aproj
Bin
CMakeCache.txt
CMakeFiles
cmake_install.cmake
common
CTestTestfile.cmake
DartConfiguration.tcl
depends
_deps
Lib
Makefile
project
test
Testing

CMakeLists.txt Outdated Show resolved Hide resolved
@ScottBailey
Copy link
Contributor Author

If I run cmake .. for the first time I think build.ninja file appeared and I could build project with ninja. If I created new directory build2 and run there cmake .. it did not generate build.ninja. I don't think this is expected? Content of build2:

mikel@msi:~/repo/antler-proj/build2$ ls -1a
 <lines removed>
Makefile
<lines removed>

At this time, CMake's default generator is Unix Makefiles. This will work using make; however, I believe ninja is a better tool for building in most cases, including this one.

The command to generate ninja build files is somthing like this:
mkdir -p Build && cd Build && cmake .. -GNinja

Available generators can be found using the command cmake --help.

@ScottBailey
Copy link
Contributor Author

After first cmake .. if I try to do it again I get:

mikel@msi:~/repo/antler-proj/build$ cmake ..
[ 11%] Performing update step for 'ryml-populate'
[ 22%] Performing patch step for 'ryml-populate'
patching file CMakeLists.txt
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file CMakeLists.txt.rej
  <------------ lines removed ------------>

I have to do following cleanup:

mikel@msi:~/repo/antler-proj/build$ dir=`pwd`
mikel@msi:~/repo/antler-proj/build$ cd /home/mikel/repo/antler-proj/build/_deps/ryml-src/
mikel@msi:~/repo/antler-proj/build/_deps/ryml-src$ git restore CMakeLists.txt
mikel@msi:~/repo/antler-proj/build/_deps/ryml-src$ cd ext/c4core
mikel@msi:~/repo/antler-proj/build/_deps/ryml-src/ext/c4core$ git restore src/c4/substr.hpp
mikel@msi:~/repo/antler-proj/build/_deps/ryml-src/ext/c4core$ git restore src/c4/std/string.hpp
mikel@msi:~/repo/antler-proj/build/_deps/ryml-src/ext/c4core$ cd $dir

and later I can generate cmake again:

Alternatively you could clear the build directory or remove build/_deps.

I will add something regarding tools in the README file, but I am not sure how much detail is too much.

@ScottBailey
Copy link
Contributor Author

Later I found out that at least cmake 3.20 is needed (Because of command `cmake_path` used). >

I think we should target CMake v3.11. I will add the appropriate code to select between cmake_path and get_filename_component based on version.

README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
aproj/aproj-add-app.cpp Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
@larryk85 larryk85 removed the request for review from dimas1185 March 14, 2023 20:07
@larryk85 larryk85 merged commit e6d1830 into main Mar 14, 2023
@larryk85 larryk85 deleted the initial_dev branch March 14, 2023 20:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
5 participants