dvm-system / sapfor

SAPFOR (System FOR Automated Parallelization)
Apache License 2.0
5 stars 5 forks source link

Review getting started instructions #5

Open echoix opened 1 year ago

echoix commented 1 year ago

Before starting, I would like to say that I appreciate the work done in this project and the projects related and integrated together. I explored the repo and what I could find as documentation and think it's what I'd like to try out, and would really like to explore it.

However, I couldn't get the installation working, after like 7h of trying. It's not my first time playing with devcontainers, neither with Docker, but only have limited CMake experience.

Would it be possible for someone in this project to retry from scratch (no cache or existing build artifacts) to set up an environment, following the instructions, to see if it still works? I wasn't able by myself to have the initial CMake invocation finishing configurating. What's interesting now, is that it can be launched in GitHub codespaces too, to check in a clean environment, but obviously it doesn't start up neither.

Ideally blockers that prevent the CMake installation to proceed should be fixed, but there is also a possibility of having a prebuilt container image to be pulled that could be published. That way, there would at least be an older version available.

Additional details: I'd like to play with a Fortran project

kaniandr commented 1 year ago

@echoix, thanks for the pull request. I approved it and made some other fixes in container configuration, so for me, it now works well in GitHub codespaces (with 8 GB RAM and 1 CMake thread). Unfortunately, if more threads are active or less memory is available, the linking process runs out of memory. You can set manually Cmake: Parallel Jobs property in VSCode. Also, if VScode asks you to select CMake Kit for SAPFOR, I recomend to leave it unspecified. I also build SAPFOR from scratch in VSCode 1.77.1 on my desktop computer.

Actually, some LLVM libraries were missing (in previous versions of LLVM they were in the main LLVM package) and there were some problems with permissions (now the root user is always used, however, it still seems not the best solution).

If you still cannot get the installation working, please, provide more details about errors you facing on.

echoix commented 1 year ago

I remember CMake complaining that there was missing DVM_DIR, once there was missing PACKAGE_LLVM or LLVM_PROJECT_DIR, and a complaining of missing Fortran compiler.

I'm running a new clone now, I'll try to come back later if it's not finished before I have to leave.

echoix commented 1 year ago

Ok, I finished running the build. I'm not sure that this indicates that it was finished successfully.

image image image

Details

``` Running the postCreateCommand from devcontainer.json... [333387 ms] Start: Run in container: /bin/sh -c .devcontainer/create.sh Submodule 'analyzers/dyna' (https://github.com/dvm-system/dyna.git) registered for path 'analyzers/dyna' Submodule 'analyzers/tsar' (https://github.com/dvm-system/tsar.git) registered for path 'analyzers/tsar' Submodule 'bcl' (https://github.com/dvm-system/bcl.git) registered for path 'bcl' Submodule 'gui/tsar-advisor' (https://github.com/dvm-system/tsar-advisor.git) registered for path 'gui/tsar-advisor' Cloning into '/workspaces/sapfor/analyzers/dyna'... Cloning into '/workspaces/sapfor/analyzers/tsar'... Cloning into '/workspaces/sapfor/bcl'... Cloning into '/workspaces/sapfor/gui/tsar-advisor'... Submodule path 'analyzers/dyna': checked out '511ba9f21d8082f4e7c7c9b5fcbe9f626eb886e4' Submodule path 'analyzers/tsar': checked out '856a50461e16bd6dd63e3bf72028925003e48527' Submodule path 'bcl': checked out '3d10ec8de8e1ec96c2d9aa37f63bbe6ec6cd9b46' Submodule path 'gui/tsar-advisor': checked out 'caa431547cbb67c035bd91f69878350a936da79c' Entering 'analyzers/dyna' Entering 'analyzers/tsar' Entering 'bcl' Entering 'gui/tsar-advisor' Entering 'analyzers/dyna' Previous HEAD position was 511ba9f add signal handlers Switched to branch 'master' Your branch is up to date with 'origin/master'. Entering 'analyzers/tsar' Previous HEAD position was 856a5046 [TSAR, Tfm, Clang, Replace] Fix, determine which parameters are unused after all other checks. Switched to branch 'master' Your branch is up to date with 'origin/master'. Entering 'bcl' Previous HEAD position was 3d10ec8 [BCL, Build] Defer configuration because some options are set in subdirectories. Switched to branch 'master' Your branch is up to date with 'origin/master'. Entering 'gui/tsar-advisor' Previous HEAD position was caa4315 [CMake] Configure CMake to build and install VSCode extension. Switched to branch 'master' Your branch is up to date with 'origin/master'. Entering 'analyzers/dyna' Current branch master is up to date. Entering 'analyzers/tsar' Current branch master is up to date. Entering 'bcl' Current branch master is up to date. Entering 'gui/tsar-advisor' Current branch master is up to date. Cloning into 'tsar-test'... remote: Enumerating objects: 5982, done. remote: Counting objects: 100% (1030/1030), done. remote: Compressing objects: 100% (616/616), done. remote: Total 5982 (delta 428), reused 974 (delta 391), pack-reused 4952 Receiving objects: 100% (5982/5982), 727.83 KiB | 2.80 MiB/s, done. Resolving deltas: 100% (2666/2666), done. loading initial cache file ../CMakeCache.in -- The CXX compiler identification is GNU 9.4.0 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Perl: /usr/bin/perl (found version "5.30.0") -- Perl version: 5.30.0 -- The C compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Performing Test HAVE_FFI_CALL -- Performing Test HAVE_FFI_CALL - Success -- Found FFI: /usr/lib/x86_64-linux-gnu/libffi.so -- Performing Test Terminfo_LINKABLE -- Performing Test Terminfo_LINKABLE - Success -- Found Terminfo: /usr/lib/x86_64-linux-gnu/libtinfo.so -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") -- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.10") CMake Warning at analyzers/tsar/CMakeLists.txt:129 (message): Flang compiler is not found, build with limited Fortran support -- Specifying LLVM dependences (include directories, libraries, macros etc.) -- Linker detection: GNU ld -- Specifying LLVM dependences (include directories, libraries, macros etc.) - done -- BCL version: 3.0 -- Could NOT find Google Test. -- Perl version: 5.30.0 -- Perl executable: /usr/bin/perl -- TSAR version: 3.0.0-alpha.2 -- TSAR based on LLVM version: 15.0.7 -- TSAR default configuration: UNKNOWN -- LLVM version: 15.0.7 -- Find llvm-link configuration: RELEASE -- llvm-link executable: /usr/lib/llvm-15/bin/llvm-link -- Lookup for Clang in /usr/lib/llvm-15/lib/cmake/clang -- Find Clang configuration: RELEASE -- Clang executable: /usr/lib/llvm-15/bin/clang-15 CMake Warning at extensions/tsar-test/CMakeLists.txt:192 (message): Could NOT find DVM executable. Set DVM_DIR to run DVMH-based tests. -- Configuring done -- Generating done -- Build files have been written to: /workspaces/sapfor/build Done. Press any key to close the terminal. ```

echoix commented 1 year ago

Also, have you considered adding a .gitignore to this repo, such as https://www.toptal.com/developers/gitignore?templates=cmake,perl,visualstudiocode,batch,linux,windows,macos,git

and adding

/build

?

I ended up using the following to not have 1k+ modified files pending to be pushed.

Details

```.gitignore # Created by https://www.toptal.com/developers/gitignore/api/cmake,perl,visualstudiocode,batch,linux,windows,macos,git # Edit at https://www.toptal.com/developers/gitignore?templates=cmake,perl,visualstudiocode,batch,linux,windows,macos,git ### Batch ### # BatchFiles *.bat *.cmd *.btm ### CMake ### CMakeLists.txt.user CMakeCache.txt CMakeFiles CMakeScripts Testing Makefile cmake_install.cmake install_manifest.txt compile_commands.json CTestTestfile.cmake _deps ### CMake Patch ### # External projects *-prefix/ ### Git ### # Created by git for backups. To disable backups in Git: # $ git config --global mergetool.keepBackup false *.orig # Created by git when using merge tools for conflicts *.BACKUP.* *.BASE.* *.LOCAL.* *.REMOTE.* *_BACKUP_*.txt *_BASE_*.txt *_LOCAL_*.txt *_REMOTE_*.txt ### Linux ### *~ # temporary files which can be created if a process still has a handle open of a deleted file .fuse_hidden* # KDE directory preferences .directory # Linux trash folder which might appear on any partition or disk .Trash-* # .nfs files are created when an open file is removed but is still being accessed .nfs* ### macOS ### # General .DS_Store .AppleDouble .LSOverride # Icon must end with two \r Icon # Thumbnails ._* # Files that might appear in the root of a volume .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns .com.apple.timemachine.donotpresent # Directories potentially created on remote AFP share .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk ### macOS Patch ### # iCloud generated files *.icloud ### Perl ### !Build/ .last_cover_stats /META.yml /META.json /MYMETA.* *.o *.pm.tdy *.bs # Devel::Cover cover_db/ # Devel::NYTProf nytprof.out # Dist::Zilla /.build/ # Module::Build _build/ Build Build.bat # Module::Install inc/ # ExtUtils::MakeMaker /blib/ /_eumm/ /*.gz /Makefile /Makefile.old /MANIFEST.bak /pm_to_blib /*.zip ### VisualStudioCode ### .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json !.vscode/*.code-snippets # Local History for Visual Studio Code .history/ # Built Visual Studio Code Extensions *.vsix ### VisualStudioCode Patch ### # Ignore all local history of files .history .ionide ### Windows ### # Windows thumbnail cache files Thumbs.db Thumbs.db:encryptable ehthumbs.db ehthumbs_vista.db # Dump file *.stackdump # Folder config file [Dd]esktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # Windows Installer files *.cab *.msi *.msix *.msm *.msp # Windows shortcuts *.lnk # End of https://www.toptal.com/developers/gitignore/api/cmake,perl,visualstudiocode,batch,linux,windows,macos,git /build ```

echoix commented 1 year ago

so for me, it now works well in GitHub codespaces (with 8 GB RAM and 1 CMake thread).

If you don't need it, I suggest that you delete the non running codespace after use, since using containers other than their universal image takes part of the storage allowance that is taken up per day and per size stored. I didn't understand at first why my usage was increasing when I only used for one project for a weekend, and after that I didn't have any usage left at the end of the month.

kaniandr commented 1 year ago

Your CMake configuration is almost successful, so now you can build SAPFOR with the CMake: Build command.

kaniandr commented 1 year ago

If you don't need it, I suggest that you delete the non running codespace after use, since using containers other than their universal image takes part of the storage allowance that is taken up per day and per size stored.

I didn't know that before, thank you.

echoix commented 1 year ago

Thanks a lot for your feedback! Indeed, I dumbly figured out after posting that it was the configure step that was done, not the build, so I ran it and I think it succeeded when I left. So I'll be able to play with it.

I assume I need to place the code of the project I want to analyze in a certain folder.

There is also a link to some wiki, that's what I'm inferring from the automatic translation: image image image

( https://github.com/dvm-system/tsar/wiki/Building-Guide )