Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for building with cmake #222

Merged
merged 10 commits into from
Oct 10, 2023

Conversation

diamant3
Copy link
Contributor

This is my PR for the issue #122

@diamant3
Copy link
Contributor Author

I will add later the build instruction based on OS/platform, I draft this for now

@diamant3 diamant3 marked this pull request as draft October 10, 2023 09:55
@diamant3 diamant3 marked this pull request as ready for review October 10, 2023 12:58
@diamant3
Copy link
Contributor Author

Need testing for building in MacOS because i don't have MacOS machine :(

README.md Outdated Show resolved Hide resolved
@diamant3
Copy link
Contributor Author

We can now add some required commands or something depending on their OS :)

@grzanka
Copy link
Contributor

grzanka commented Oct 10, 2023

Need testing for building in MacOS because i don't have MacOS machine :(

I have one at home and can make some tests tomorrow

@diamant3
Copy link
Contributor Author

Got it! thanks!

@grzanka
Copy link
Contributor

grzanka commented Oct 10, 2023

image

seems like some typo

@diamant3
Copy link
Contributor Author

ohh sorry, let me fix that

@diamant3
Copy link
Contributor Author

Sorry i forgot to change, it's fixed now :D

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
diamant3 and others added 3 commits October 10, 2023 21:29
Co-authored-by: Leszek Grzanka <grzanka@agh.edu.pl>
Co-authored-by: Leszek Grzanka <grzanka@agh.edu.pl>
Co-authored-by: Leszek Grzanka <grzanka@agh.edu.pl>
@diamant3
Copy link
Contributor Author

I will leave it open for the test of MacOS build, anyway thank you so much for the review!

@grzanka
Copy link
Contributor

grzanka commented Oct 10, 2023

I will leave it open for the test of MacOS build, anyway thank you so much for the review!

Instruction works well:

grzanka@MacBook-Air tmp % git clone https://github.com/libamtrack/library.git
Cloning into 'library'...
remote: Enumerating objects: 11786, done.
remote: Counting objects: 100% (454/454), done.
remote: Compressing objects: 100% (296/296), done.
remote: Total 11786 (delta 240), reused 276 (delta 116), pack-reused 11332
Receiving objects: 100% (11786/11786), 26.98 MiB | 15.36 MiB/s, done.
Resolving deltas: 100% (7965/7965), done.
grzanka@MacBook-Air tmp % cd library && mkdir build
grzanka@MacBook-Air library % cmake -S . -B build
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is AppleClang 15.0.0.15000040
-- The CXX compiler identification is AppleClang 15.0.0.15000040
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found GSL: /opt/homebrew/include (found version "2.7.1") 
CMake Deprecation Warning at example/demo/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Warning (dev) at example/demo/CMakeLists.txt:17 (target_link_libraries):
  Policy CMP0023 is not set: Plain and keyword target_link_libraries
  signatures cannot be mixed.  Run "cmake --help-policy CMP0023" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The keyword signature for target_link_libraries has already been used with
  the target "amtrack_demo".  All uses of target_link_libraries with a target
  should be either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * example/demo/CMakeLists.txt:11 (target_link_libraries)

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Deprecation Warning at example/basic_plots/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at test/C/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Configuring done (0.9s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/grzanka/tmp/library/build
grzanka@MacBook-Air library % cmake --build build --parallel
[  2%] Building C object CMakeFiles/amtrack.dir/src/AT_Algorithms_GSM.c.o
[  4%] Building C object CMakeFiles/amtrack.dir/src/AT.c.o
[  7%] Building C object CMakeFiles/amtrack.dir/src/AT_DataRange.c.o
[  9%] Building C object CMakeFiles/amtrack.dir/src/AT_DataParticle.c.o
[ 14%] Building C object CMakeFiles/amtrack.dir/src/AT_Constants.c.o
[ 14%] Building C object CMakeFiles/amtrack.dir/src/AT_Algorithms_CPP.c.o
[ 17%] Building C object CMakeFiles/amtrack.dir/src/AT_EnergyLoss.c.o
[ 21%] Building C object CMakeFiles/amtrack.dir/src/AT_Algorithms_IGK.c.o
[ 21%] Building C object CMakeFiles/amtrack.dir/src/AT_Error.c.o
[ 24%] Building C object CMakeFiles/amtrack.dir/src/AT_ElectronRange.c.o
[ 26%] Building C object CMakeFiles/amtrack.dir/src/AT_GammaResponse.c.o
[ 29%] Building C object CMakeFiles/amtrack.dir/src/AT_DataMaterial.c.o
[ 31%] Building C object CMakeFiles/amtrack.dir/src/AT_KatzModel_Implementation.c.o
[ 34%] Building C object CMakeFiles/amtrack.dir/src/AT_MultipleCoulombScattering.c.o
[ 36%] Building C object CMakeFiles/amtrack.dir/src/AT_NumericalRoutines.c.o
[ 39%] Building C object CMakeFiles/amtrack.dir/src/AT_Histograms.c.o
[ 41%] Building C object CMakeFiles/amtrack.dir/src/AT_KatzModel.c.o
[ 43%] Building C object CMakeFiles/amtrack.dir/src/AT_ProtonAnalyticalBeamParameters.c.o
[ 46%] Building C object CMakeFiles/amtrack.dir/src/AT_RDD_ExtendedTarget.c.o
[ 48%] Building C object CMakeFiles/amtrack.dir/src/AT_RDD.c.o
[ 51%] Building C object CMakeFiles/amtrack.dir/src/AT_PhysicsRoutines.c.o
[ 56%] Building C object CMakeFiles/amtrack.dir/src/AT_RDD_ShellAveraged.c.o
[ 56%] Building C object CMakeFiles/amtrack.dir/src/AT_SPC.c.o
[ 58%] Building C object CMakeFiles/amtrack.dir/src/AT_ProbabilityDistributions.c.o
[ 60%] Building C object CMakeFiles/amtrack.dir/src/AT_ProtonAnalyticalModels.c.o
[ 63%] Building C object CMakeFiles/amtrack.dir/src/AT_RDD_Tabulated.c.o
[ 68%] Building C object CMakeFiles/amtrack.dir/src/AT_StoppingPower.c.o
[ 68%] Building C object CMakeFiles/amtrack.dir/src/AT_RDD_Simple.c.o
[ 70%] Building C object CMakeFiles/amtrack.dir/src/AT_StoppingPowerData.c.o
[ 73%] Building C object CMakeFiles/amtrack.dir/src/AT_StoppingPowerDataBethe.c.o
[ 75%] Building C object CMakeFiles/amtrack.dir/src/AT_StoppingPowerDataICRU.c.o
[ 78%] Building C object CMakeFiles/amtrack.dir/src/AT_StoppingPowerDataPSTAR.c.o
[ 80%] Building C object CMakeFiles/amtrack.dir/src/AT_SuccessiveConvolutions.c.o
[ 82%] Building C object CMakeFiles/amtrack.dir/src/AT_StoppingPowerDataFromFile.c.o
/Users/grzanka/tmp/library/src/AT_EnergyLoss.c:487:83: warning: passing arguments to 'AT_lambda_Landau_FWHM_left' without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
    return (AT_lambda_Vavilov_FWHM_right(kappa, beta) - AT_lambda_Landau_FWHM_left(kappa, beta));
                                                                                  ^
1 warning generated.
[ 85%] Linking C shared library libamtrack.dylib
[ 85%] Built target amtrack
[ 92%] Building C object example/demo/CMakeFiles/amtrack_demo.dir/AT_demo.c.o
[ 92%] Building C object example/basic_plots/CMakeFiles/amtrack_plots.dir/AT_plot.c.o
[ 92%] Building C object test/C/CMakeFiles/amtrack_test.dir/AT_test.c.o
[ 95%] Linking C executable amtrack_test
[ 97%] Linking C executable amtrack_demo
[100%] Linking C executable amtrack_plots
[100%] Built target amtrack_test
[100%] Built target amtrack_demo
[100%] Built target amtrack_plots
grzanka@MacBook-Air library % cmake --install build
-- Install configuration: ""
-- Installing: /usr/local/lib/libamtrack.dylib
-- Installing: /usr/local/bin/amtrack_demo
-- Installing: /usr/local/bin/amtrack_plots
-- Installing: /usr/local/bin/amtrack_test
grzanka@MacBook-Air library % amtrack_demo
dyld[93930]: Library not loaded: @rpath/libamtrack.dylib
  Referenced from: <8B4CAB4A-C497-311D-8053-3B42C41F1D10> /usr/local/bin/amtrack_demo
  Reason: no LC_RPATH's found
zsh: abort      amtrack_demo
grzanka@MacBook-Air library % amtrack_test
dyld[94008]: Library not loaded: @rpath/libamtrack.dylib
  Referenced from: <ED479A48-FDD3-3B4F-8C15-DFF49AA624E9> /usr/local/bin/amtrack_test
  Reason: no LC_RPATH's found
zsh: abort      amtrack_test

There are some issues with the CMakes, but that's a different issue.

@grzanka grzanka merged commit 097518d into libamtrack:master Oct 10, 2023
4 checks passed
@diamant3 diamant3 deleted the update-readme branch October 10, 2023 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants