Skip to content

build fails with errors like "fatal error: 'clang/AST/AST.h' file not found" #23

@BenWibking

Description

@BenWibking

I've installed Clang 19.1.7 using Conda on macOS:

(base) ➜  build git:(master) clang++ --version
clang version 19.1.7
Target: arm64-apple-darwin24.5.0
Thread model: posix
InstalledDir: /Users/benwibking/miniforge3/bin
(base) ➜  build git:(master) llvm-config --version
19.1.7

However, when I try to build FPChecker, I get lots of errors:

(base) ➜  build git:(master) cmake -DCMAKE_INSTALL_PREFIX=$HOME/fpchecker_install -DCMAKE_CXX_STANDARD=17 ..
-- The CXX compiler identification is Clang 19.1.7
-- The C compiler identification is Clang 19.1.7
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/benwibking/miniforge3/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/benwibking/miniforge3/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python3: /opt/homebrew/Frameworks/Python.framework/Versions/3.13/bin/python3.13 (found version "3.13.5") found components: Interpreter
-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - NOTFOUND
-- CMAKE_CXX_COMPILE_FLAGS:
-- CMAKE_CXX_COMPILER: /Users/benwibking/miniforge3/bin/clang++
-- CMAKE_CXX_FLAGS: -I/Users/benwibking/miniforge3/include -std=c++17 -stdlib=libc++  -fno-exceptions -funwind-tables -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -O3 -g -std=c++14
-- CMAKE_CPP_FLAGS: -I/Users/benwibking/miniforge3/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-- CMAKE_SHARED_LINKER_FLAGS: -L/Users/benwibking/miniforge3/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
-- CMAKE_INSTALL_PREFIX: /Users/benwibking/fpchecker_install
-- Configuring done (5.2s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/benwibking/amrex_codes/FPChecker/build
(base) ➜  build git:(master) ninja
[1/17] Building C object CMakeFiles/fpchecker_intercept_lib.dir/interception_tool/intercept.c.o
FAILED: [code=1] CMakeFiles/fpchecker_intercept_lib.dir/interception_tool/intercept.c.o
/Users/benwibking/miniforge3/bin/clang -Dfpchecker_intercept_lib_EXPORTS -I/Users/benwibking/amrex_codes/FPChecker/build -arch arm64 -fPIC -MD -MT CMakeFiles/fpchecker_intercept_lib.dir/interception_tool/intercept.c.o -MF CMakeFiles/fpchecker_intercept_lib.dir/interception_tool/intercept.c.o.d -o CMakeFiles/fpchecker_intercept_lib.dir/interception_tool/intercept.c.o -c /Users/benwibking/amrex_codes/FPChecker/interception_tool/intercept.c
/Users/benwibking/amrex_codes/FPChecker/interception_tool/intercept.c:111:18: error: use of undeclared identifier 'environ'
  111 |     char **ptr = environ;
      |                  ^
1 error generated.
[2/17] Building CXX object CMakeFiles/fpchecker_plugin.dir/plugin/instrumentation_plugin.cpp.o
FAILED: [code=1] CMakeFiles/fpchecker_plugin.dir/plugin/instrumentation_plugin.cpp.o
/Users/benwibking/miniforge3/bin/clang++ -Dfpchecker_plugin_EXPORTS  -I/Users/benwibking/miniforge3/include -std=c++17 -stdlib=libc++  -fno-exceptions -funwind-tables -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -O3 -g -std=c++14 -std=gnu++17 -arch arm64 -fPIC -MD -MT CMakeFiles/fpchecker_plugin.dir/plugin/instrumentation_plugin.cpp.o -MF CMakeFiles/fpchecker_plugin.dir/plugin/instrumentation_plugin.cpp.o.d -o CMakeFiles/fpchecker_plugin.dir/plugin/instrumentation_plugin.cpp.o -c /Users/benwibking/amrex_codes/FPChecker/plugin/instrumentation_plugin.cpp
/Users/benwibking/amrex_codes/FPChecker/plugin/instrumentation_plugin.cpp:14:10: fatal error: 'clang/AST/AST.h' file not found
   14 | #include "clang/AST/AST.h"
      |          ^~~~~~~~~~~~~~~~~
1 error generated.
[5/17] Building CXX object CMakeFiles/fpchecker_cpu.dir/src/CodeMatching.cpp.o
FAILED: [code=1] CMakeFiles/fpchecker_cpu.dir/src/CodeMatching.cpp.o
/Users/benwibking/miniforge3/bin/clang++ -Dfpchecker_cpu_EXPORTS  -I/Users/benwibking/miniforge3/include -std=c++17 -stdlib=libc++  -fno-exceptions -funwind-tables -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -O3 -g -std=c++14 -std=gnu++17 -arch arm64 -fPIC -MD -MT CMakeFiles/fpchecker_cpu.dir/src/CodeMatching.cpp.o -MF CMakeFiles/fpchecker_cpu.dir/src/CodeMatching.cpp.o.d -o CMakeFiles/fpchecker_cpu.dir/src/CodeMatching.cpp.o -c /Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:22:14: error: no template named 'map' in namespace 'std'; did you mean 'max'?
   22 | typedef std::map<std::string, std::vector<unsigned> > key_val_pair_t;
      |         ~~~~~^~~
      |              max
/Users/benwibking/miniforge3/bin/../include/c++/v1/__algorithm/max.h:29:1: note: 'max' declared here
   29 | max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) {
      | ^
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:22:14: error: a type specifier is required for all declarations
   22 | typedef std::map<std::string, std::vector<unsigned> > key_val_pair_t;
      | ~~~~~~~      ^
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:22:14: error: typedef declarator cannot be qualified
   22 | typedef std::map<std::string, std::vector<unsigned> > key_val_pair_t;
      |         ~~~~~^
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:22:14: error: typedef name must be an identifier
   22 | typedef std::map<std::string, std::vector<unsigned> > key_val_pair_t;
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:22:54: error: expected ';' after top level declarator
   22 | typedef std::map<std::string, std::vector<unsigned> > key_val_pair_t;
      |                                                      ^
      |                                                      ;
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:23:14: error: no template named 'map' in namespace 'std'; did you mean 'max'?
   23 | typedef std::map<const GlobalValue *, key_val_pair_t> global_val_annot_t;
      |         ~~~~~^~~
      |              max
/Users/benwibking/miniforge3/bin/../include/c++/v1/__algorithm/max.h:29:1: note: 'max' declared here
   29 | max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) {
      | ^
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:23:39: error: use of undeclared identifier 'key_val_pair_t'
   23 | typedef std::map<const GlobalValue *, key_val_pair_t> global_val_annot_t;
      |                                       ^
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:24:14: error: no template named 'map' in namespace 'std'; did you mean 'max'?
   24 | typedef std::map<const Module *, global_val_annot_t> per_module_annot_t;
      |         ~~~~~^~~
      |              max
/Users/benwibking/miniforge3/bin/../include/c++/v1/__algorithm/max.h:29:1: note: 'max' declared here
   29 | max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) {
      | ^
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:24:34: error: use of undeclared identifier 'global_val_annot_t'
   24 | typedef std::map<const Module *, global_val_annot_t> per_module_annot_t;
      |                                  ^
9 errors generated.
[6/17] Building CXX object CMakeFiles/fpchecker.dir/src/CodeMatching.cpp.o
FAILED: [code=1] CMakeFiles/fpchecker.dir/src/CodeMatching.cpp.o
/Users/benwibking/miniforge3/bin/clang++ -Dfpchecker_EXPORTS -I/Users/benwibking/amrex_codes/FPChecker/src -I/Users/benwibking/miniforge3/include -std=c++17 -stdlib=libc++  -fno-exceptions -funwind-tables -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -O3 -g -std=c++14 -std=gnu++17 -arch arm64 -fPIC -MD -MT CMakeFiles/fpchecker.dir/src/CodeMatching.cpp.o -MF CMakeFiles/fpchecker.dir/src/CodeMatching.cpp.o.d -o CMakeFiles/fpchecker.dir/src/CodeMatching.cpp.o -c /Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:22:14: error: no template named 'map' in namespace 'std'; did you mean 'max'?
   22 | typedef std::map<std::string, std::vector<unsigned> > key_val_pair_t;
      |         ~~~~~^~~
      |              max
/Users/benwibking/miniforge3/bin/../include/c++/v1/__algorithm/max.h:29:1: note: 'max' declared here
   29 | max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) {
      | ^
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:22:14: error: a type specifier is required for all declarations
   22 | typedef std::map<std::string, std::vector<unsigned> > key_val_pair_t;
      | ~~~~~~~      ^
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:22:14: error: typedef declarator cannot be qualified
   22 | typedef std::map<std::string, std::vector<unsigned> > key_val_pair_t;
      |         ~~~~~^
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:22:14: error: typedef name must be an identifier
   22 | typedef std::map<std::string, std::vector<unsigned> > key_val_pair_t;
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:22:54: error: expected ';' after top level declarator
   22 | typedef std::map<std::string, std::vector<unsigned> > key_val_pair_t;
      |                                                      ^
      |                                                      ;
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:23:14: error: no template named 'map' in namespace 'std'; did you mean 'max'?
   23 | typedef std::map<const GlobalValue *, key_val_pair_t> global_val_annot_t;
      |         ~~~~~^~~
      |              max
/Users/benwibking/miniforge3/bin/../include/c++/v1/__algorithm/max.h:29:1: note: 'max' declared here
   29 | max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) {
      | ^
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:23:39: error: use of undeclared identifier 'key_val_pair_t'
   23 | typedef std::map<const GlobalValue *, key_val_pair_t> global_val_annot_t;
      |                                       ^
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:24:14: error: no template named 'map' in namespace 'std'; did you mean 'max'?
   24 | typedef std::map<const Module *, global_val_annot_t> per_module_annot_t;
      |         ~~~~~^~~
      |              max
/Users/benwibking/miniforge3/bin/../include/c++/v1/__algorithm/max.h:29:1: note: 'max' declared here
   29 | max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) {
      | ^
/Users/benwibking/amrex_codes/FPChecker/src/CodeMatching.cpp:24:34: error: use of undeclared identifier 'global_val_annot_t'
   24 | typedef std::map<const Module *, global_val_annot_t> per_module_annot_t;
      |                                  ^
9 errors generated.
[7/17] Building CXX object CMakeFiles/fpchecker_cpu.dir/src/driver_cpu.cpp.o
FAILED: [code=1] CMakeFiles/fpchecker_cpu.dir/src/driver_cpu.cpp.o
/Users/benwibking/miniforge3/bin/clang++ -Dfpchecker_cpu_EXPORTS  -I/Users/benwibking/miniforge3/include -std=c++17 -stdlib=libc++  -fno-exceptions -funwind-tables -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -O3 -g -std=c++14 -std=gnu++17 -arch arm64 -fPIC -MD -MT CMakeFiles/fpchecker_cpu.dir/src/driver_cpu.cpp.o -MF CMakeFiles/fpchecker_cpu.dir/src/driver_cpu.cpp.o.d -o CMakeFiles/fpchecker_cpu.dir/src/driver_cpu.cpp.o -c /Users/benwibking/amrex_codes/FPChecker/src/driver_cpu.cpp
/Users/benwibking/amrex_codes/FPChecker/src/driver_cpu.cpp:18:10: fatal error: 'llvm/Transforms/IPO/PassManagerBuilder.h' file not found
   18 | #include "llvm/Transforms/IPO/PassManagerBuilder.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[8/17] Building CXX object CMakeFiles/fpchecker.dir/src/driver.cpp.o
FAILED: [code=1] CMakeFiles/fpchecker.dir/src/driver.cpp.o
/Users/benwibking/miniforge3/bin/clang++ -Dfpchecker_EXPORTS -I/Users/benwibking/amrex_codes/FPChecker/src -I/Users/benwibking/miniforge3/include -std=c++17 -stdlib=libc++  -fno-exceptions -funwind-tables -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -O3 -g -std=c++14 -std=gnu++17 -arch arm64 -fPIC -MD -MT CMakeFiles/fpchecker.dir/src/driver.cpp.o -MF CMakeFiles/fpchecker.dir/src/driver.cpp.o.d -o CMakeFiles/fpchecker.dir/src/driver.cpp.o -c /Users/benwibking/amrex_codes/FPChecker/src/driver.cpp
/Users/benwibking/amrex_codes/FPChecker/src/driver.cpp:18:10: fatal error: 'llvm/Transforms/IPO/PassManagerBuilder.h' file not found
   18 | #include "llvm/Transforms/IPO/PassManagerBuilder.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[9/17] Building CXX object CMakeFiles/fpchecker_cpu.dir/src/Instrumentation_cpu.cpp.o
FAILED: [code=1] CMakeFiles/fpchecker_cpu.dir/src/Instrumentation_cpu.cpp.o
/Users/benwibking/miniforge3/bin/clang++ -Dfpchecker_cpu_EXPORTS  -I/Users/benwibking/miniforge3/include -std=c++17 -stdlib=libc++  -fno-exceptions -funwind-tables -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -O3 -g -std=c++14 -std=gnu++17 -arch arm64 -fPIC -MD -MT CMakeFiles/fpchecker_cpu.dir/src/Instrumentation_cpu.cpp.o -MF CMakeFiles/fpchecker_cpu.dir/src/Instrumentation_cpu.cpp.o.d -o CMakeFiles/fpchecker_cpu.dir/src/Instrumentation_cpu.cpp.o -c /Users/benwibking/amrex_codes/FPChecker/src/Instrumentation_cpu.cpp
/Users/benwibking/amrex_codes/FPChecker/src/Instrumentation_cpu.cpp:223:33: error: no matching member function for call to 'CreateAlignedLoad'
  223 |         auto loadInst = builder.CreateAlignedLoad(fName, MaybeAlign(), "my");
      |                         ~~~~~~~~^~~~~~~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/IR/IRBuilder.h:1817:13: note: candidate function not viable: no known conversion from 'GlobalVariable *' to 'Type *' for 1st argument
 1817 |   LoadInst *CreateAlignedLoad(Type *Ty, Value *Ptr, MaybeAlign Align,
      |             ^                 ~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/IR/IRBuilder.h:1812:13: note: candidate function not viable: requires 4 arguments, but 3 were provided
 1812 |   LoadInst *CreateAlignedLoad(Type *Ty, Value *Ptr, MaybeAlign Align,
      |             ^                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1813 |                               const char *Name) {
      |                               ~~~~~~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/IR/IRBuilder.h:1822:13: note: candidate function not viable: requires at least 4 arguments, but 3 were provided
 1822 |   LoadInst *CreateAlignedLoad(Type *Ty, Value *Ptr, MaybeAlign Align,
      |             ^                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1823 |                               bool isVolatile, const Twine &Name = "") {
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[10/17] Building CXX object CMakeFiles/fpchecker.dir/src/Instrumentation.cpp.o
FAILED: [code=1] CMakeFiles/fpchecker.dir/src/Instrumentation.cpp.o
/Users/benwibking/miniforge3/bin/clang++ -Dfpchecker_EXPORTS -I/Users/benwibking/amrex_codes/FPChecker/src -I/Users/benwibking/miniforge3/include -std=c++17 -stdlib=libc++  -fno-exceptions -funwind-tables -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -O3 -g -std=c++14 -std=gnu++17 -arch arm64 -fPIC -MD -MT CMakeFiles/fpchecker.dir/src/Instrumentation.cpp.o -MF CMakeFiles/fpchecker.dir/src/Instrumentation.cpp.o.d -o CMakeFiles/fpchecker.dir/src/Instrumentation.cpp.o -c /Users/benwibking/amrex_codes/FPChecker/src/Instrumentation.cpp
/Users/benwibking/amrex_codes/FPChecker/src/Instrumentation.cpp:172:6: warning: variable 'instrumentedOps' set but not used [-Wunused-but-set-variable]
  172 |         int instrumentedOps = 0;
      |             ^
/Users/benwibking/amrex_codes/FPChecker/src/Instrumentation.cpp:401:38: error: no member named 'getInt8PtrTy' in 'llvm::Type'; did you mean 'getInt8Ty'?
  401 |         ArrayType *t = ArrayType::get(Type::getInt8PtrTy(mod->getContext()), 1);
      |                                       ~~~~~~^~~~~~~~~~~~
      |                                             getInt8Ty
/Users/benwibking/miniforge3/include/llvm/IR/Type.h:461:23: note: 'getInt8Ty' declared here
  461 |   static IntegerType *getInt8Ty(LLVMContext &C);
      |                       ^
/Users/benwibking/amrex_codes/FPChecker/src/Instrumentation.cpp:473:52: error: no member named 'getInt64PtrTy' in 'llvm::Type'; did you mean 'getIntNTy'?
  473 |                         auto addCast = new AddrSpaceCastInst(gep, Type::getInt64PtrTy(mod->getContext(), 0), "my", retInst);
      |                                                                   ~~~~~~^~~~~~~~~~~~~
      |                                                                         getIntNTy
/Users/benwibking/miniforge3/include/llvm/IR/Type.h:459:23: note: 'getIntNTy' declared here
  459 |   static IntegerType *getIntNTy(LLVMContext &C, unsigned N);
      |                       ^
/Users/benwibking/amrex_codes/FPChecker/src/Instrumentation.cpp:475:31: error: no matching member function for call to 'CreateAlignedLoad'
  475 |       auto loadInst = builder.CreateAlignedLoad(addCast, MaybeAlign(), "my");
      |                       ~~~~~~~~^~~~~~~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/IR/IRBuilder.h:1817:13: note: candidate function not viable: no known conversion from 'AddrSpaceCastInst *' to 'Type *' for 1st argument
 1817 |   LoadInst *CreateAlignedLoad(Type *Ty, Value *Ptr, MaybeAlign Align,
      |             ^                 ~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/IR/IRBuilder.h:1812:13: note: candidate function not viable: requires 4 arguments, but 3 were provided
 1812 |   LoadInst *CreateAlignedLoad(Type *Ty, Value *Ptr, MaybeAlign Align,
      |             ^                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1813 |                               const char *Name) {
      |                               ~~~~~~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/IR/IRBuilder.h:1822:13: note: candidate function not viable: requires at least 4 arguments, but 3 were provided
 1822 |   LoadInst *CreateAlignedLoad(Type *Ty, Value *Ptr, MaybeAlign Align,
      |             ^                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1823 |                               bool isVolatile, const Twine &Name = "") {
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/benwibking/amrex_codes/FPChecker/src/Instrumentation.cpp:535:52: error: no member named 'getInt64PtrTy' in 'llvm::Type'; did you mean 'getIntNTy'?
  535 |                         auto addCast = new AddrSpaceCastInst(gep, Type::getInt64PtrTy(mod->getContext(), 0), "my", retInst);
      |                                                                   ~~~~~~^~~~~~~~~~~~~
      |                                                                         getIntNTy
/Users/benwibking/miniforge3/include/llvm/IR/Type.h:459:23: note: 'getIntNTy' declared here
  459 |   static IntegerType *getIntNTy(LLVMContext &C, unsigned N);
      |                       ^
/Users/benwibking/amrex_codes/FPChecker/src/Instrumentation.cpp:602:50: error: no member named 'getInt64PtrTy' in 'llvm::Type'; did you mean 'getIntNTy'?
  602 |         auto addCast = new AddrSpaceCastInst(gep, Type::getInt64PtrTy(mod->getContext(), 0), "my", inst);
      |                                                   ~~~~~~^~~~~~~~~~~~~
      |                                                         getIntNTy
/Users/benwibking/miniforge3/include/llvm/IR/Type.h:459:23: note: 'getIntNTy' declared here
  459 |   static IntegerType *getIntNTy(LLVMContext &C, unsigned N);
      |                       ^
/Users/benwibking/amrex_codes/FPChecker/src/Instrumentation.cpp:614:4: error: no viable conversion from 'llvm::AtomicOrdering' to 'MaybeAlign'
  614 |                         AtomicOrdering::SequentiallyConsistent,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/Support/Alignment.h:126:3: note: candidate constructor not viable: no known conversion from 'llvm::AtomicOrdering' to 'const MaybeAlign &' for 1st argument
  126 |   MaybeAlign(const MaybeAlign &Other) = default;
      |   ^          ~~~~~~~~~~~~~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/Support/Alignment.h:128:3: note: candidate constructor not viable: no known conversion from 'llvm::AtomicOrdering' to 'MaybeAlign &&' for 1st argument
  128 |   MaybeAlign(MaybeAlign &&Other) = default;
      |   ^          ~~~~~~~~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/Support/Alignment.h:131:13: note: candidate constructor not viable: no known conversion from 'llvm::AtomicOrdering' to 'std::nullopt_t' for 1st argument
  131 |   constexpr MaybeAlign(std::nullopt_t None) : UP(None) {}
      |             ^          ~~~~~~~~~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/Support/Alignment.h:132:13: note: candidate constructor not viable: no known conversion from 'llvm::AtomicOrdering' to 'Align' for 1st argument
  132 |   constexpr MaybeAlign(Align Value) : UP(Value) {}
      |             ^          ~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/Support/Alignment.h:133:12: note: explicit constructor is not a candidate
  133 |   explicit MaybeAlign(uint64_t Value) {
      |            ^
/Users/benwibking/miniforge3/include/llvm/IR/IRBuilder.h:1846:70: note: passing argument to parameter 'Align' here
 1846 |   CreateAtomicCmpXchg(Value *Ptr, Value *Cmp, Value *New, MaybeAlign Align,
      |                                                                      ^
/Users/benwibking/amrex_codes/FPChecker/src/Instrumentation.cpp:650:56: error: no member named 'getInt64PtrTy' in 'llvm::Type'; did you mean 'getIntNTy'?
  650 |         auto addCastTmp = new AddrSpaceCastInst(gepTmp, Type::getInt64PtrTy(mod->getContext(), 0), "my", firstInst);
      |                                                         ~~~~~~^~~~~~~~~~~~~
      |                                                               getIntNTy
/Users/benwibking/miniforge3/include/llvm/IR/Type.h:459:23: note: 'getIntNTy' declared here
  459 |   static IntegerType *getIntNTy(LLVMContext &C, unsigned N);
      |                       ^
/Users/benwibking/amrex_codes/FPChecker/src/Instrumentation.cpp:657:4: error: no viable conversion from 'llvm::AtomicOrdering' to 'MaybeAlign'
  657 |                         AtomicOrdering::SequentiallyConsistent,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/Support/Alignment.h:126:3: note: candidate constructor not viable: no known conversion from 'llvm::AtomicOrdering' to 'const MaybeAlign &' for 1st argument
  126 |   MaybeAlign(const MaybeAlign &Other) = default;
      |   ^          ~~~~~~~~~~~~~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/Support/Alignment.h:128:3: note: candidate constructor not viable: no known conversion from 'llvm::AtomicOrdering' to 'MaybeAlign &&' for 1st argument
  128 |   MaybeAlign(MaybeAlign &&Other) = default;
      |   ^          ~~~~~~~~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/Support/Alignment.h:131:13: note: candidate constructor not viable: no known conversion from 'llvm::AtomicOrdering' to 'std::nullopt_t' for 1st argument
  131 |   constexpr MaybeAlign(std::nullopt_t None) : UP(None) {}
      |             ^          ~~~~~~~~~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/Support/Alignment.h:132:13: note: candidate constructor not viable: no known conversion from 'llvm::AtomicOrdering' to 'Align' for 1st argument
  132 |   constexpr MaybeAlign(Align Value) : UP(Value) {}
      |             ^          ~~~~~~~~~~~
/Users/benwibking/miniforge3/include/llvm/Support/Alignment.h:133:12: note: explicit constructor is not a candidate
  133 |   explicit MaybeAlign(uint64_t Value) {
      |            ^
/Users/benwibking/miniforge3/include/llvm/IR/IRBuilder.h:1846:70: note: passing argument to parameter 'Align' here
 1846 |   CreateAtomicCmpXchg(Value *Ptr, Value *Cmp, Value *New, MaybeAlign Align,
      |                                                                      ^
1 warning and 8 errors generated.
[12/17] Building CXX object CMakeFiles/fpchecker_cpu.dir/src/Utility.cpp.o
ninja: build stopped: subcommand failed.

Is there a flag that I'm missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions