microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.27k stars 6.42k forks source link

[New Port Request] Fort #10439

Closed MVoz closed 4 years ago

MVoz commented 4 years ago

Library name: Fort

Library description: Fort project is to create a Fortran front-end for the LLVM compiler

Source repository URL: https://github.com/llvm-fortran/fort

Project homepage (if different from the source repository): http://fort-compiler.org

Fort vs Flang:

Fort, just like Clang, is designed to be easily understandable; it has virtually no learning curve for developers familiar with LLVM or Clang
Fort implements its own compilation pipeline (rather than piggy-backing on Clang) which reduces complexity of the project and allows for faster builds
Fort compiles against LLVM components and produces LLVM IR in memory, which allows catching many of potential IR issues at compile time
Fort follows LLVM release lifecycle from get-go
Fort supports all LLVM targets
Flang emits LLVM IR as text, which is error-prone and often forces to check output only at runtime
Fort uses LLVM diagnostics
Tooling API

Note: it was recently announced that Nvidia is undertaking some form of a rewrite of Flang. Stay tuned for updates to the comparison. Fort vs GNU Fortran

Pro’s of GNU Fortran vs fort:

Much more complete Fortran support
GNU Fortran (and GCC in general) supports more targets

Pro’s of fort vs GNU Fortran:

Fort ASTs and design are intended to be easily understandable
Fort is designed as an API, which allows it to be used as a foundation for other tools
BSD-style license (can be embedded in other products)
Clear and concise diagnostics

build> cmake .. -LA -GNinja -DCMAKE_BUILD_TYPE=Release

-- Found LLVM_CONFIG as E:/tools/LLVM/8.0/x64/bin/llvm-config.exe
-- Using Release VC++ CRT: MD
-- Fort version: 8.0.1
-- Configuring done
-- Generating done
-- Build files have been written to: E:/tools/vcpkg/buildtrees/fort/src/8-e8e4c8402b/build
-- Cache values
BUG_REPORT_URL:STRING=https://github.com/llvm-fortran/fort/issues
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_CXX_COMPILER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
CMAKE_CXX_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3 /GR /EHsc
CMAKE_CXX_FLAGS_DEBUG:STRING=/MDd /Zi /Ob0 /Od /RTC1
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG
CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /DNDEBUG
CMAKE_CXX_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
CMAKE_C_COMPILER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
CMAKE_C_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3
CMAKE_C_FLAGS_DEBUG:STRING=/MDd /Zi /Ob0 /Od /RTC1
CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG
CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /DNDEBUG
CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
CMAKE_EXE_LINKER_FLAGS:STRING=/machine:x64
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF
CMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/Fort
CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/link.exe
CMAKE_MAKE_PROGRAM:FILEPATH=C:/PROGRA~1/CMake/bin/ninja.exe
CMAKE_MODULE_LINKER_FLAGS:STRING=/machine:x64
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
CMAKE_MT:FILEPATH=C:/Program Files (x86)/Windows Kits/10/bin/10.0.19564.0/x64/mt.exe
CMAKE_RC_COMPILER:FILEPATH=C:/Program Files (x86)/Windows Kits/10/bin/10.0.19564.0/x64/rc.exe
CMAKE_RC_FLAGS:STRING=-DWIN32
CMAKE_RC_FLAGS_DEBUG:STRING=-D_DEBUG
CMAKE_RC_FLAGS_MINSIZEREL:STRING=
CMAKE_RC_FLAGS_RELEASE:STRING=
CMAKE_RC_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=/machine:x64
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO
CMAKE_STATIC_LINKER_FLAGS:STRING=/machine:x64
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
C_INCLUDE_DIRS:STRING=
DEFAULT_SYSROOT:PATH=
FORT_EXECUTABLE_VERSION:STRING=8
FORT_INCLUDE_DOCS:BOOL=OFF
FORT_RESOURCE_DIR:STRING=
FORT_TABLEGEN:STRING=fort-tblgen
FORT_VENDOR:STRING=
GCC_INSTALL_PREFIX:PATH=
LIBFORT_LIBRARY_VERSION:STRING=8
LLVM_BINARY_DIR:PATH=E:/tools/LLVM/8.0/x64
LLVM_BUILD_INSTRUMENTED:STRING=OFF
LLVM_BUILD_INSTRUMENTED_COVERAGE:BOOL=OFF
LLVM_CONFIG:FILEPATH=E:/tools/LLVM/8.0/x64/bin/llvm-config.exe
LLVM_ENABLE_ASSERTIONS:BOOL=OFF
LLVM_ENABLE_EH:BOOL=OFF
LLVM_ENABLE_IDE:BOOL=OFF
LLVM_ENABLE_IR_PGO:BOOL=OFF
LLVM_ENABLE_LTO:STRING=OFF
LLVM_ENABLE_PDB:BOOL=OFF
LLVM_ENABLE_RTTI:BOOL=OFF
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS:BOOL=OFF
LLVM_FORCE_ENABLE_STATS:BOOL=OFF
LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN:BOOL=OFF
LLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF
LLVM_LIBRARY_DIR:PATH=E:/tools/LLVM/8.0/x64/lib
LLVM_LIT:FILEPATH=LLVM_LIT-NOTFOUND
LLVM_MAIN_INCLUDE_DIR:PATH=E:/tools/LLVM/8.0/x64/include
LLVM_MAIN_SRC_DIR:PATH=C:/Users/qt/work/build/llvm/llvm
LLVM_PARALLEL_COMPILE_JOBS:STRING=
LLVM_PARALLEL_LINK_JOBS:STRING=
LLVM_TABLEGEN_EXE:FILEPATH=E:/tools/LLVM/8.0/x64/bin/llvm-tblgen.exe
LLVM_TOOLS_BINARY_DIR:PATH=E:/tools/LLVM/8.0/x64/bin
LLVM_USE_CRT_DEBUG:STRING=MDd
LLVM_USE_CRT_RELEASE:STRING=MD

Release MSVC x64 Windows Build OK, Debug error

VCPKG error, llvm-config error and lib "unresolved external symbol" many :(((

fort --version

fort version 8.0.1

fort --help

OVERVIEW: Fortran compiler

USAGE: fort

OPTIONS: -### Print (but do not run) the commands to run for this compilation -ast-dump Build ASTs and then debug dump them -ast-print Build ASTs and then pretty-print them -C Include comments in preprocessed output -c Compile only -- only run preprocess, compile, and assemble steps -emit-llvm Use the LLVM representation for assembler and object files -f77 compile with Fortran77 features -fdefault-double-8 set the kind of the default double type to 8 -fdefault-integer-8 set the kind of the default integer type to 8 -fdefault-real-8 set the kind of the default real type to 8 -ffixed-form the source files are using fixed form layout -ffixed-line-length- maximum allowed line length in fixed form, 0 or 'none' to disable the limit -ffree-form the source files are using free form layout -ffree-line-length- maximum allowed line length in free form, 0 or 'none' to disable the limit -fsyntax-only Stop after checking syntax -g Generate source-level debug information --help-hidden Display help for hidden options -help Display available options -I

Add directory to include search path -L Add directory to library search path --migrate Run the migrator -o Write output to -S Emit assembly -- only run preprocess and compilation steps -triple Specify target triple (e.g. i686-apple-darwin9) -verify Run the verifier --version Print version information -v Show commands to run and use verbose output

PhoebeHui commented 4 years ago

If you wish to add this port in the future, you can reopen this issue, but we're closing it for now.