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

new p4 programs compilation (bf_p4c, p4_build dir missing) #37

Open
lorepap opened this issue Jan 20, 2025 · 32 comments
Open

new p4 programs compilation (bf_p4c, p4_build dir missing) #37

lorepap opened this issue Jan 20, 2025 · 32 comments
Labels
question Further information is requested

Comments

@lorepap
Copy link

lorepap commented Jan 20, 2025

Hi,

I'm trying to build new p4 programs using the Tofino target and I'm having some issues.

In the pkgsrc/p4-examples/p4_16_programs/README.md I found the following instructions

An example program can be compiled by using the provided build scripts by using the instructions below if nothing different is stated in its readme file:

export SDE=/path/to/sde/
export SDE_INSTALL=$SDE/install
export PATH=$SDE_INSTALL/bin:$PATH
cd $SDE/pkgsrc/p4-build
./autogen.sh
cd $SDE/build/p4-examples


For Tofino:

$SDE/pkgsrc/p4-build/configure --with-tofino --with-p4c=p4c --prefix=$SDE_INSTALL \
      --bindir=$SDE_INSTALL/bin \
      P4_NAME=<program name> \
      P4_PATH=$SDE/pkgsrc/p4-examples/p4_16_programs/<program name>/<program name>.p4 \
      P4_VERSION=p4-16 P4_ARCHITECTURE=tna \
      LDFLAGS="-L$SDE_INSTALL/lib"

I couldn't find any p4-build directory, so compilation is not possible following the first method. I also tried to use the p4studio tool, but cmake fails as the tool requires bf_p4c compiler, which apparently is missing (only open-source p4c compiler is present).

So, I was able to compile a new p4 program using p4c with target tofino, but when I try to run bf_switchd, I get the following error:

/home/ubuntu/open-p4studio/run_switchd.sh --arch tofino -p heavy_hitter
Using SDE /home/ubuntu/open-p4studio
Using SDE_INSTALL /home/ubuntu/open-p4studio/install
Setting up DMA Memory Pool
File /home/ubuntu/open-p4studio/install/share/p4/targets/tofino/heavy_hitter.conf not found

Apparently, there is a .conf file for each p4 program that has to be generated using the Tofino-specific toolchain at compilation time. For all existing p4 examples in this repository, the .conf has been already generated.

I'm new to the p4 world and Tofino architectures, so I'd really appreciate any support and clarification.
I'm eager to provide more information about the issue if needed.

Thank you for your time!

@jafingerhut
Copy link
Contributor

@vgurevich Do you have recommendations here, perhaps ones that you could create a README file somewhere in the repo (or a new section in the top level README.md file) that would answer this question for future users?

@vgurevich
Copy link
Contributor

vgurevich commented Jan 21, 2025

@jafingerhut --yes. It looks to me like that the contents of the file the reporter refers to is totally out-of-date. Let me try to do it in the next couple of days.

@lorepap -- please, ignore those instructions. They are completely obsolete and irrelevant.

Here is the official way to do it:

rm –rf   $SDE/build/p4-build/<program_name>

mkdir –p $SDE/build/p4-build/<program_name>
cd       $SDE/build/p4-build/<program_name>
cmake $SDE/p4studio                                         \
     -DCMAKE_MODULE_PATH="$SDE/cmake"                       \
     -DCMAKE_INSTALL_PREFIX="$SDE_INSTALL"                  \
     -DP4_PATH=<the_p4_program_directory>/<program_name>.p4 \
     -DP4_NAME=<program_name>                               \
     -DP4_LANG=p4_16                                        \
     -DTOFINO={ON | OFF} –DTOFINO2={ON | OFF}

make [VERBOSE=1] -j install

Unofficially, you can download P4ica tools from https://github.com/p4ica/tools and use the p4_build.sh script, e.g.:

~/tools/p4_build.sh <your P4 file>

Happy hacking,
Vladimir

@fruffy fruffy added the question Further information is requested label Jan 21, 2025
@jafingerhut
Copy link
Contributor

The steps in your comment above appear to be very different than the steps you added in this PR, Vlad: #40

Are you thinking of creating another PR that documents your answer above?

@vgurevich
Copy link
Contributor

@jafingerhut -- yes, indeed. There are two issues at hand:

  1. README files with the information that is totally incorrect and obsolete. Update p4-examples README #40 fixed one of these, and there are more to go.
  2. The question on how to compile someone's own code that is not an SDE example. This is a very different procedure (at least as of today)

Unfortunately knowing the answer to (1) is not going to help with (2).

We might consider creating a doc directory and put some additional README files there.

@jafingerhut
Copy link
Contributor

A new top-level directory named doc sounds perfect to me. At first I'd say just create new files in there as desired. If it starts to get unwieldy at any point, we can consider restructuring it, but that might be a while.

@lorepap
Copy link
Author

lorepap commented Jan 25, 2025

Hi,

Thank you for the update.
I've been able to go through the new doc files and the new instructions.

I first tried the following

rm –rf   $SDE/build/p4-build/<program_name>
mkdir –p $SDE/build/p4-build/<program_name>
cd       $SDE/build/p4-build/<program_name>
cmake $SDE/p4studio                                         \
     -DCMAKE_MODULE_PATH="$SDE/cmake”                       \
     -DCMAKE_INSTALL_PREFIX="$SDE_INSTALL”                  \
     -DP4_PATH=<the_p4_program_directory>/<program_name>.p4 \
     -DP4_NAME=<program_name>                               \
     -DP4_LANG=p4_16                                        \
     -DTOFINO={ON | OFF} –DTOFINO2={ON | OFF}
make [VERBOSE=1] -j install

The problem here is the same as before: p4studio tool assumes that bf-p4c compiler is installed, but it's missing. So it returns the following error during compilation:

-- 
Using SDE: /home/ubuntu/open-p4studio
-- 
Using SDE_INSTALL: /home/ubuntu/open-p4studio/install
-- 
P4_LANG: p4-16
P4C: P4C-NOTFOUND
P4C-GEN_BRFT-CONF: /home/ubuntu/open-p4studio/install/bin/p4c-gen-bfrt-conf
P4C-MANIFEST-CONFIG: /home/ubuntu/open-p4studio/install/bin/p4c-manifest-config
-- 
P4_PATH: /home/ubuntu/tofino-test/heavy_hitter.p4
P4_NAME: heavy_hitter
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/tofino-test/build/heavy_hitter
compile.sh: line 30: -DP4_NAME=heavy_hitter.p4: command not found
Scanning dependencies of target bf-p4c
Scanning dependencies of target driver
[  0%] Built target driver
[  0%] Built target bf-p4c
Scanning dependencies of target heavy_hitter-tofino
[100%] Generating heavy_hitter/tofino/bf-rt.json
make[2]: P4C-NOTFOUND: Command not found
make[2]: *** [CMakeFiles/heavy_hitter-tofino.dir/build.make:61: heavy_hitter/tofino/bf-rt.json] Error 127
make[1]: *** [CMakeFiles/Makefile2:108: CMakeFiles/heavy_hitter-tofino.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Then, I tried to download the automatic building script p4-build.sh from https://github.com/p4ica/tools and run ~/tools/p4_build.sh <your P4 file>

However, I get the following error:

Using SDE          /home/ubuntu/open-p4studio
Using SDE_INSTALL /home/ubuntu/open-p4studio/install
  ERROR: SDE manifest file not found in $SDE

So apparently, it's looking for a .manifest file to get the SDE version, which is missing. I looked into the p4_build.sh file (lines 353-362):

# Check SDE version
#
if SDE_MANIFEST=`ls $SDE/bf-sde-*.manifest 2> /dev/null`; then
    echo Using SDE version `basename $SDE_MANIFEST .manifest`
    echo
else
    echo "  ERROR: SDE manifest file not found in \$SDE"
    exit 1
fi

Let me know if there is anything I'm missing!

Thank you

@vgurevich
Copy link
Contributor

vgurevich commented Jan 25, 2025

@lorepap -- thank you for pointing the issues.

Here is what's going on and the workarounds you can use:

  1. The main issue is that open-p4studio installs the Tofino P4 Compiler under the name p4c, whereas all the tools (including the cmake infra you tried to use) expect it to be bf-pc. I filed the issue Install Tofino P4 compiler as "bf-p4c" not "p4c" #50 for that, but for now you have a couple of workarounds at your disposal.
    a. Either create a symlink in $SDE_INSTALL/bin, i.e.
cd $SDE_INSTALL/bin
ln -s p4c bf-p4c

b. Or add another cmake variable -DP4C=$SDE_INSTALL/bin/p4c to the cmake command line you previously used

  1. The script p4_build.sh (and actually a couple of others in the tools directory) do, indeed, check for the SDE manifest file, just to make sure they are executed in the correct place and that the environment variables do point to something that resembles a real SDE directory. The easiest workaround is to create such a file yourself:
touch $SDE/bf-sde-open-p4studio.manifest

a. The script still expects the compiler to be called bf-p4c and thus this workaround needs to be combined with (1.a) (assuming that you want to use the script instead of the "raw" cmake)

Happy hacking,
Vladimir

@Gold778b
Copy link

Gold778b commented Feb 5, 2025

After removing libabsl dependencies of the p4c-barefoot compiler I get an error:

Scanning dependencies of target driver
Scanning dependencies of target bf-p4c
[ 0%] Built target driver
[ 0%] Built target bf-p4c
Scanning dependencies of target basic-tofino
[100%] Generating basic/tofino/bf-rt.json
/opt/open-p4studio/install/bin/p4c-barefoot: symbol lookup error: /opt/open-p4studio/install/bin/p4c-barefoot: undefined symbol: _ZN4absl12lts_2023080213hash_internal15MixingHashState5kSeedE
make[2]: *** [CMakeFiles/basic-tofino.dir/build.make:61: basic/tofino/bf-rt.json] Error 127
make[1]: *** [CMakeFiles/Makefile2:135: CMakeFiles/basic-tofino.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
========================= make.log =========================

ERROR: For the details and to obtain technical support see the file
/opt/open-p4studio/logs/p4-build/tofino/basic/make.log

@jafingerhut
Copy link
Contributor

After removing libabsl dependencies of the p4c-barefoot compiler I get an error:

Can you please explain your motivation for removing dependencies like libasl?

There are only a few ways tested in this repository to successfully build this software from source code. I believe they are all documented in the top-level README, and I don't recall any of them suggesting removing dependencies.

@Gold778b
Copy link

Gold778b commented Feb 5, 2025

@jafingerhut I was getting a number of errors when compiling a new module on P4, for example:
/opt/open-p4studio/install/bin/p4c-barefoot: error while loading shared libraries: libabsl_log_internal_check_op.so.2308.0.0: cannot open shared object file: No such file or directory

@Gold778b
Copy link

Gold778b commented Feb 5, 2025

@jafingerhut @vgurevich Currently, we can launch and test ready-made Tofino modules. Has anyone been able to compile and run the new module on P4 using the p4c-barefoot compiler?

@vgurevich
Copy link
Contributor

@Gold778b -- are you asking whether people can compile and run their own P4 programs using the compiler included in open-tofino?

If so, the answer is "yes"

@jafingerhut
Copy link
Contributor

Did you follow this step in the README?

./create-setup-script.sh > ~/setup-open-p4studio.bash

If yes, did you do source ~/setup-open-p4studio.bash in the terminal where you were trying to run p4c-barefoot? Or did you add that command in a shell init file like ~/.bashrc?

Did you install this software on a freshly installed Ubuntu 20.04 or 22.04 system, x86_64 processor architecture? If you try to install it on a system where you have other P4-related software on it, I would bet against such a combination working correctly.

@Gold778b
Copy link

Gold778b commented Feb 5, 2025

@vgurevich Yes, I’m interested in the compiler from the open-tofino project.

@Gold778b
Copy link

Gold778b commented Feb 5, 2025

@jafingerhut I use Ubuntu 20.04 x86_64 virtual machine. SDE installed successfully. Finished projects are launched. Can't compile new code on P4. Clean system. ./create-setup-script.sh > ~/setup-open-p4studio.bash
Used this step during installation.

@jafingerhut
Copy link
Contributor

@jafingerhut I use Ubuntu 20.04 x86_64 virtual machine. SDE installed successfully. Finished projects are launched. Can't compile new code on P4. Clean system. ./create-setup-script.sh > ~/setup-open-p4studio.bash Used this step during installation.

In the terminal where you tried running the p4c-barefoot command, did you do source ~/setup-open-p4studio.bash ?

@Gold778b
Copy link

Gold778b commented Feb 5, 2025

@jafingerhut No, I added it to bashrc.

@jafingerhut
Copy link
Contributor

If you can let us know which install steps you followed (there are 2 different methods mentioned in the README, at least), and attach the contents of any log file like the one mentioned in the error message you showed: ERROR: For the details and to obtain technical support see the file /opt/open-p4studio/logs/p4-build/tofino/basic/make.log to a comment (you might need to rename it with a suffix .txt first for Github's file name restrictions), I can compare it against a successful build I have done and see if I notice anything unusual.

@Gold778b
Copy link

Gold778b commented Feb 5, 2025

@jafingerhut I used the method ./p4studio/p4studio interactive. Attached is the compilation file. Thank you.

2.txt

@jafingerhut
Copy link
Contributor

When using the interactive method, do you recall which submodules you enabled/disabled?

@Gold778b
Copy link

Gold778b commented Feb 5, 2025

I won't say for sure. I don't remember. But I also previously tried compiling using the first method on another Ubuntu 20.04 virtual machine and Debian11. I get the same error when compiling new P4 code.

@fruffy
Copy link
Contributor

fruffy commented Feb 5, 2025

I assume the LD_LIBRARY_PATH is not set correctly. What happens if you use export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/open-p4studio/install/lib/ before calling the binary?

@Gold778b
Copy link

Gold778b commented Feb 6, 2025

@fruffy This works for me.
@jafingerhut @vgurevich @fruffy Thanks for your help. Great. It worked.

@jafingerhut
Copy link
Contributor

@Gold778b If you look in your ~/setup-open-p4studio.bash file, doesn't it contain the following line?

LD_LIBRARY_PATH=/opt/open-p4studio/install/lib

If so, then if you are doing source ~/setup-open-p4studio.bash, then I don't understand what was going wrong before.

@Gold778b
Copy link

Gold778b commented Feb 6, 2025

@jafingerhut The problem is probably related to manually adding variables without directly copying from the setup-open-p4studio.bash file to bashrc. Therefore, I made a mistake. From the point of view of the instructions, everything is correct.

Maybe consider adding variables to bashrc automatically when installing SDE?

@fruffy
Copy link
Contributor

fruffy commented Feb 6, 2025

What it is the output when you use ldd p4c-barefoot? Curious to see what libraries are currently linked there.

@Gold778b
Copy link

Gold778b commented Feb 6, 2025

@fruffy
root@nv-140268:/opt/open-p4studio# ldd /opt/open-p4studio/install/bin/p4c-barefoot
linux-vdso.so.1 (0x00007ffc4b928000)
libboost_iostreams.so.1.67.0 => /opt/open-p4studio/install/lib/libboost_iostreams.so.1.67.0 (0x00007f4f5c805000)
libprotobuf.so.25.0.0 => /opt/open-p4studio/install/lib/libprotobuf.so.25.0.0 (0x00007f4f5bfb8000)
libabsl_log_internal_check_op.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_log_internal_check_op.so.2308.0.0 (0x00007f4f5bfae000)
libabsl_status.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_status.so.2308.0.0 (0x00007f4f5bf84000)
libabsl_log_internal_message.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_log_internal_message.so.2308.0.0 (0x00007f4f5bf64000)
libabsl_log_internal_nullguard.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_log_internal_nullguard.so.2308.0.0 (0x00007f4f5bf5f000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4f5bf4f000)
libabsl_cord.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_cord.so.2308.0.0 (0x00007f4f5beee000)
libabsl_str_format_internal.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_str_format_internal.so.2308.0.0 (0x00007f4f5bea0000)
libabsl_raw_hash_set.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_raw_hash_set.so.2308.0.0 (0x00007f4f5be92000)
libabsl_hash.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_hash.so.2308.0.0 (0x00007f4f5be8d000)
libabsl_stacktrace.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_stacktrace.so.2308.0.0 (0x00007f4f5be88000)
libabsl_symbolize.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_symbolize.so.2308.0.0 (0x00007f4f5be7a000)
libabsl_time.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_time.so.2308.0.0 (0x00007f4f5be49000)
libabsl_strings.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_strings.so.2308.0.0 (0x00007f4f5be0d000)
libabsl_throw_delegate.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_throw_delegate.so.2308.0.0 (0x00007f4f5be06000)
libabsl_raw_logging_internal.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_raw_logging_internal.so.2308.0.0 (0x00007f4f5bdfe000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4f5bc1c000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4f5bacb000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4f5bab0000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4f5ba8d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4f5b89b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4f6a1f8000)
libz.so.1 => /opt/open-p4studio/install/lib/libz.so.1 (0x00007f4f5b876000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f4f5b863000)
libabsl_die_if_null.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_die_if_null.so.2308.0.0 (0x00007f4f5b85b000)
libabsl_statusor.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_statusor.so.2308.0.0 (0x00007f4f5b84f000)
libabsl_log_internal_conditions.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_log_internal_conditions.so.2308.0.0 (0x00007f4f5b84a000)
libabsl_cordz_info.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_cordz_info.so.2308.0.0 (0x00007f4f5b83c000)
libabsl_synchronization.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_synchronization.so.2308.0.0 (0x00007f4f5b815000)
libabsl_time_zone.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_time_zone.so.2308.0.0 (0x00007f4f5b7b3000)
libabsl_spinlock_wait.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_spinlock_wait.so.2308.0.0 (0x00007f4f5b7ac000)
libabsl_strerror.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_strerror.so.2308.0.0 (0x00007f4f5b7a6000)
libabsl_examine_stack.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_examine_stack.so.2308.0.0 (0x00007f4f5b7a1000)
libabsl_log_internal_format.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_log_internal_format.so.2308.0.0 (0x00007f4f5b797000)
libabsl_log_internal_proto.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_log_internal_proto.so.2308.0.0 (0x00007f4f5b790000)
libabsl_log_internal_log_sink_set.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_log_internal_log_sink_set.so.2308.0.0 (0x00007f4f5b77c000)
libabsl_log_internal_globals.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_log_internal_globals.so.2308.0.0 (0x00007f4f5b776000)
libabsl_log_globals.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_log_globals.so.2308.0.0 (0x00007f4f5b76a000)
libabsl_base.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_base.so.2308.0.0 (0x00007f4f5b75c000)
libabsl_cord_internal.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_cord_internal.so.2308.0.0 (0x00007f4f5b72a000)
libabsl_crc_cord_state.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_crc_cord_state.so.2308.0.0 (0x00007f4f5b710000)
libabsl_cordz_functions.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_cordz_functions.so.2308.0.0 (0x00007f4f5b70b000)
libabsl_int128.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_int128.so.2308.0.0 (0x00007f4f5b701000)
libabsl_city.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_city.so.2308.0.0 (0x00007f4f5b6fb000)
libabsl_low_level_hash.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_low_level_hash.so.2308.0.0 (0x00007f4f5b6f6000)
libabsl_debugging_internal.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_debugging_internal.so.2308.0.0 (0x00007f4f5b6ea000)
libabsl_demangle_internal.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_demangle_internal.so.2308.0.0 (0x00007f4f5b6de000)
libabsl_malloc_internal.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_malloc_internal.so.2308.0.0 (0x00007f4f5b6d5000)
libabsl_strings_internal.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_strings_internal.so.2308.0.0 (0x00007f4f5b6cf000)
libabsl_cordz_handle.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_cordz_handle.so.2308.0.0 (0x00007f4f5b6bf000)
libabsl_graphcycles_internal.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_graphcycles_internal.so.2308.0.0 (0x00007f4f5b6b3000)
libabsl_kernel_timeout_internal.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_kernel_timeout_internal.so.2308.0.0 (0x00007f4f5b6a9000)
libabsl_log_sink.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_log_sink.so.2308.0.0 (0x00007f4f5b6a4000)
libabsl_crc32c.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_crc32c.so.2308.0.0 (0x00007f4f5b699000)
libabsl_exponential_biased.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_exponential_biased.so.2308.0.0 (0x00007f4f5b692000)
libabsl_crc_internal.so.2308.0.0 => /opt/open-p4studio/install/lib/libabsl_crc_internal.so.2308.0.0 (0x00007f4f5b68a000)

@fruffy
Copy link
Contributor

fruffy commented Feb 6, 2025

Thanks, it looks like there are a lot of dynamically linked libraries. Might be worthwhile to link them statically to reduce errors like this.

@jafingerhut
Copy link
Contributor

It only takes one dynamically linked library in the open-p4studio/install/lib directory to require a correct setting of the LD_LIBRARY_PATH environment variable. The SDE and SDE_INSTALL environment variables are, I believe, required by other commands in open-p4studio.

I don't see any advantage to eliminating the requirement of setting a single environment variable when several are required. That is the reason I added a small program that creates the necessary Bash script that should be sourced, and added it to the top level README instructions.

I can emphasize that slightly further by adding to the top level README that you should strongly consider adding this line to you ~/.bashrc file when the install is nearly done:

source ~/setup-open-p4studio.bash

If that instruction is there in the install steps, and followed, then this particular problem can be avoided.

@Gold778b
Copy link

Gold778b commented Feb 6, 2025

@jafingerhut It might be better to point out the addition and use of environment variables for SDE at the end of the README.md file.

@jafingerhut
Copy link
Contributor

jafingerhut commented Feb 6, 2025

@jafingerhut It might be better to point out the addition and use of environment variables for SDE at the end of the README.md file.

You are welcome to read and provide your comments on this PR's changes to the README.md file, to see if it looks like they make anything clearer than before: https://github.com/p4lang/open-p4studio/pull/68/files

If you want to see the formatted README.md without the mix of old and new hunks of diffs potentially confusing things, see here for the proposed new version:

@vgurevich
Copy link
Contributor

Please, see #51. This will help to preserve SDE compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants