[P4-dev] Installing P4 sample switch

Antonin Bas antonin at barefootnetworks.com
Thu Sep 1 16:10:29 EDT 2016


Hi Sarath,

I would recommend installing bmv2 in a standard system location. Just run
"sudo make install" after having compiled bmv2. Then switch will have no
issue finding bmv2 and the pdfixed headers.
Once bmv2 is installed, please run "./configure --with-bmv2
--with-switchsai" again in your switch directory. You do not need to worry
about p4-build, as the switch configure script will take care of running
the p4-build configure script.
So in a nutshell I would say the only thing missing from your steps is the
installation of bmv2 with "sudo make install".
You may want to pay attention to the output of the switch configure script.
If everything goes smoothly, you should see a short recap message at the
end with the detail of the options you provided.

Please let us know if you run into more issues.

Best,

Antonin

On Wed, Aug 31, 2016 at 7:44 PM, Sarath Kamisetty <
sarath.kamisetty at gmail.com> wrote:

> Hi,
>
> I am trying to follow the instructions posted in
> https://github.com/p4lang/switch to compile and run the switch
> (switch.p4). Is there one single script that performs all the steps ? I
> couldn't find one. Any other documentation to get this up and running will
> be helpful.
>
> I did the following:
>
> #1) Installed PTF
> #2) Installed p4c-bmv2
> #3) Compiled bmv2 with --with-pdfixed option. Where do I install this ?
> Instructions at https://github.com/p4lang/behavioral-model only mention
> how to compile, not about installing it in any location. It is unclear how
> this switch.p4 will use this path I compiled bmv2 in.
>
> At this point, I did the following under the switch/ directory
>
> ./autogen.sh
>  ./configure --with-bmv2 --with-switchsai
>  make
>
> And "make" failed promptly with the following error:
>
> [saratk at ubuntu:~/Projects/ws1/Closet/p4/matrix/apps/switch]make
> make  all-recursive
> make[1]: Entering directory `/home/saratk/Projects/ws1/
> Closet/p4/matrix/apps/switch'
> Making all in p4-build
> make[2]: Entering directory `/home/saratk/Projects/ws1/
> Closet/p4/matrix/apps/switch/p4-build'
> make[2]: *** No rule to make target `all'.  Stop.
> make[2]: Leaving directory `/home/saratk/Projects/ws1/
> Closet/p4/matrix/apps/switch/p4-build'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/saratk/Projects/ws1/
> Closet/p4/matrix/apps/switch'
> make: *** [all] Error 2
> [saratk at ubuntu:~/Projects/ws1/Closet/p4/matrix/apps/switch]
>
> Suspecting something wrong with p4-build/, I followed instructions at
> https://github.com/p4lang/p4-build/ under switch/p4-build/ and
> "configure" step failed:
>
> ./configure --with-bmv2 P4_NAME=switch P4_PATH=/home/<user>/p4-apps/
> switch/p4src/switch.p4
>
> ...
> ...
> checking for vector... yes
> checking for p4c-bmv2... /usr/local/bin/p4c-bmv2
> *checking bm/pdfixed/pd_common.h usability... no*
> *checking bm/pdfixed/pd_common.h presence... no*
> *checking for bm/pdfixed/pd_common.h... no*
> *configure: error: bmv2 pdfixed headers not found*
> *configure: error: ./co**nfigure failed for p4-build*
>
> However, I do see these files from step 3 in different path. Is there some
> environment variable that I need to set so this step succeeds ? Pls. help.
>
> Thanks,
> Sarat
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>



-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20160901/b8d30925/attachment-0002.html>


More information about the P4-dev mailing list