Building RNTuple Project in arm64 architecture (Apple M2)

_ROOT Version: 6.28
_Platform: arm64 (Macbook-Apple M2)
_Compiler: g++

Hi, I was trying to do some tests with RNTuple in my macbook. Normally, I use a remote linux machine and since it is down sometimes, I decided to move some simple tests locally. However, when I wrote a simple code that just creates a RNTupleModel the compiler complains:

Undefined symbols for architecture arm64:
  "ROOT::Experimental::RNTupleModel::RNTupleModel()", referenced from:

However, I can still build ROOT projects in my mac.
Here is the test snippet I used:

#undef R__HAS_VDT

 #include <ROOT/RNTuple.hxx>
#include <ROOT/RNTupleModel.hxx>
#include <TRandom.h>

#include "TInterpreter.h"
#include <TROOT.h>
#include <TFile.h>
#include <TRandom.h>
#include <TRandom3.h>

R__LOAD_LIBRARY(ROOTNTuple)
using REntry = ROOT::Experimental::REntry;
using RNTupleModel = ROOT::Experimental::RNTupleModel;
using RNTupleReader = ROOT::Experimental::RNTupleReader;
using RNTupleWriter = ROOT::Experimental::RNTupleWriter;

#include<vector>
#include<thread>

#define trig_cand_length 128
#define trig_head_length 440
#define hw_sig_length 96

using namespace soa;

constexpr char const* filename = "myfile_rntuple.root";
constexpr int NWriterThreads = 16;
const int EvtsPerThreads = 25000;
void CreateRNTuple(){
    TFile *file = new TFile(filename,"RECREATE");
    //Commenting the line below -->Code Compiles.
    auto model = RNTupleModel::Create();
}

int main(){
  CreateRNTuple();
  return 1;
} 

I do realize that RNTuple is still experimental but I wanted to confirm if currently it is supported for arm64 architecture or there is some issue on my end. Please note that my ROOT projects build successfully.

Thanks

Hi @abashyal ,

undefined symbols is a linker error, so the code compiled fine (which tells me you have a ROOT installation that includes RNTuple headers). You might just have to add -lROOTNTuple to the compiler/linker flags to tell the linker you also need that library.

Cheers,
Enrico

1 Like

Thanks @eguiraud . That worked. I had to add “ROOT::ROOTNTuple” in my libraries list of the CMake File.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.