unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* no C_INCLUDE_PATH env variable defined : I can't compile C applications
@ 2022-10-22 11:07 Mohamed Amine LEGHERABA via
  2022-10-23 21:48 ` Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: Mohamed Amine LEGHERABA via @ 2022-10-22 11:07 UTC (permalink / raw)
  To: help-guix@gnu.org

Hello,
When I do "echo $C_INCLUDE_PATH" in my bash prompt (either my account or root), I have nothing.

When I run a custom guix shell (with gcc-toolchain) and I run "echo $C_INCLUDE_PATH",
I have "/gnu/store/1p21dbv408cb45zcc15v7wj0q7x99rz2-profile/include"

Without this env variable, C programs can't use "linux/limits.h" or other kernel related libraries. Any idea how to solve this problem ?

This is my config :

;; This is an operating system configuration template
;; for a "desktop" setup without full-blown desktop
;; environments.

(use-modules
(gnu)
(gnu system nss)
(ice-9 popen)
(ice-9 rdelim)
;; non guix
;(mohamed packages firefox)
(nongnu packages linux)
(nongnu packages mozilla)
(nongnu packages firmware)
(nongnu system linux-initrd))
(use-service-modules
desktop
;authentification
cups
docker
nix
networking
ssh
xorg
sddm)
(use-package-modules
bootloaders
certs
emacs
emacs-xyz
ratpoison
suckless
wm
xorg
curl
wget
version-control
compression
gnuzilla
terminals
shells
gnome
lxqt
xfce
freedesktop
disk
ssh
cups
virtualization
docker
package-management
containers
bash
)

(define (get-uuid)
(let*
(
(port (open-input-pipe "blkid -s UUID -o value /dev/nvme0n1p1"))
(str (read-line port)))
(close-pipe port)
str))

(define %xorg-libinput-config
"Section \"InputClass\"
Identifier \"libinput touchpad catchall\"
Driver \"libinput\"
MatchDriver \"libinput\"
MatchName \"PIXA3854:00 093A:0274 Touchpad\"
MatchUdevType \"touchpad\"
MatchDMIModalias \"dmi:*svnFramework:pnLaptop:*\"
AttrEventCodeDisable \"BTN_RIGHT\"
MatchDevicePath \"/dev/input/event*\"
MatchIsTouchpad \"on\"
Option \"Tapping\" \"on\"
Option \"TappingDrag\" \"on\"
Option \"DisableWhileTyping\" \"on\"
Option \"MiddleEmulation\" \"on\"
Option \"ScrollMethod\" \"twofinger\"
Option \"NaturalScrolling\" \"on\"
Option \"ClickMethod\" \"clickfinger\"
Option \"TappingButtonMap\" \"lrm\"
EndSection")

(operating-system
(kernel linux)
(initrd microcode-initrd)
;; include iwlwifi
(firmware (list linux-firmware))
(host-name "framework")
(timezone "Europe/Paris")
(locale "fr_FR.utf8")
(keyboard-layout (keyboard-layout "fr" "azerty"))
;(keyboard-layout "fr")
;; Use the UEFI variant of GRUB with the EFI System
;; Partition mounted on /boot/efi.
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets '("/boot/efi"))
(keyboard-layout keyboard-layout)))

;; Assume the target root file system is labelled "my-root" and home system is labeled "my-home"
(file-systems (append
(list (file-system
(device (file-system-label "my-root"))
(mount-point "/")
(type "ext4"))
(file-system
(device (file-system-label "my-home"))
(mount-point "/home")
(type "ext4"))
(file-system
;(device (uuid "AAAA-AAAA" 'fat))
(device (uuid (get-uuid) 'fat))
(mount-point "/boot/efi")
(type "vfat")))
%base-file-systems))
(swap-devices
(list
(swap-space
(target (file-system-label "swap")))))

(groups ;(cons (user-group (name "docker"))
%base-groups)

(users (cons (user-account
(name "mohamed")
(comment "main account")
(group "users")
;(shell (file-append zsh "/bin/zsh"))
(home-directory "/home/mohamed")
(supplementary-groups '("wheel" "netdev" "input" "tty" "docker"
"audio" "video")))
%base-user-accounts))

;; Add a bunch of window managers; we can choose one at
;; the log-in screen with F1.
(packages (append (list
;; devops
openssh
;; window managers
gnome gnome-tweaks ;sway i3-wm i3status dmenu
;; terminal emulator
xterm kitty
;; shells
;;zsh
bash
git
unzip
zip
icecat firefox
xkeyboard-config
dosfstools
;; input for touchpad
libinput xf86-input-libinput
;xf86-input-synaptics
;; getting web pages
curl wget
;; for HTTPS access
nss-certs
;; telegram client
;telegram-desktop
cups
lxd
docker
nix
qemu
;podman ; not working
)
%base-packages))

;; Use the "desktop" services, which include the X11
;; log-in service, networking with NetworkManager, and more.
(services
(cons*
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout)))
(service docker-service-type)
(service nix-service-type)
(service gnome-desktop-service-type)
(bluetooth-service #:auto-enable? #f)
(service cups-service-type
(cups-configuration
(web-interface? #t)
(extensions
(list cups-filters epson-inkjet-printer-escpr hplip-minimal brlaser))))

(modify-services %desktop-services
;; enable substitute for nonguix - should help with large packages, i.e. linux, firefox
(guix-service-type config =>
(guix-configuration
(inherit config)
(substitute-urls
(append
(list "https://substitutes.nonguix.org")
%default-substitute-urls))
(authorized-keys
(append (list (plain-file "non-guix.pub"
"(public-key
(ecc
(curve Ed25519)
(q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)))"))
%default-authorized-guix-keys))))
(gdm-service-type config =>
(gdm-configuration
(inherit config)
(wayland? #f)
(xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout)))
; (extra-config (list %xorg-libinput-config))))
; (local-file "40-libinput.conf"))))
; (extra-config
; (list
; "Section 'InputClass'
; Identifier 'Touchpads'
; Driver 'libinput'
; Option 'Tapping' 'on'
; Option 'NaturalScrolling' 'true'
; EndSection"))))
(auto-login? #t)
(default-user "mohamed"))))))

;; Allow resolution of '.local' host names with mDNS.
(name-service-switch %mdns-host-lookup-nss))

###############

And this is my home.scm :

(use-modules
(guix gexp)
(gnu home)
(gnu home services)
(gnu home services shells)
(gnu home services ssh)
(gnu services)
(gnu packages)
(gnu packages tex)
(gnu packages base)
(gnu packages admin)
(gnu packages shells)
(gnu packages telegram)
(gnu packages package-management)
(gnu packages freedesktop)
(gnu packages libreoffice)
(gnu packages video)
(gnu packages gnome)
(gnu packages ssh)
(gnu packages rust)
(gnu packages crates-io)
(gnu packages python)
(gnu packages node)
(gnu packages irc)
(gnu packages gimp)
(gnu packages disk)
(gnu packages pdf)
(gnu packages commencement)
(gnu packages imagemagick)
(gnu packages cmake)
(gnu packages llvm)
(gnu packages linux)
(nongnu packages messaging)
(mohamed packages crates)
)

(define %home-files
`(
(".gitconfig" ,(local-file "gitconfig"))
;(".config/nix/nix.conf" ,(local-file "nix.conf"))
)
)

(define %zsh-file
`(
,(local-file "zshrc")
)
)

(home-environment
(packages
(list
vlc
shotcut
openshot
texlive-base
gnu-make
openssh
htop
libreoffice
flatpak
gedit
;zsh
rust
rust-cargo-0.65 ;; from custom channel
python
node
weechat ; irc chat
gimp ; pictures editing
obs ; recording
testdisk ; repair disk
xournalpp ; edit pdf
poppler ; combine pdf
imagemagick ; pdf to jpeg
zoom ;; visio conference
gcc-toolchain ;; gcc
linux-libre-headers
;clang-toolchain
cmake ;; cmake
))
(services
(list
(service home-files-service-type %home-files)
;(service home-zsh-service-type
; (home-zsh-configuration
; (zshrc %zsh-file))) (service home-openssh-service-type))))

#############

Thanks,
Mohamed Amine LEGHERABA

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: no C_INCLUDE_PATH env variable defined : I can't compile C applications
  2022-10-22 11:07 no C_INCLUDE_PATH env variable defined : I can't compile C applications Mohamed Amine LEGHERABA via
@ 2022-10-23 21:48 ` Ricardo Wurmus
  2022-10-24  1:42   ` Re : " Mohamed Amine LEGHERABA
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2022-10-23 21:48 UTC (permalink / raw)
  To: Mohamed Amine LEGHERABA; +Cc: help-guix


Mohamed Amine LEGHERABA via <help-guix@gnu.org> writes:

> When I do "echo $C_INCLUDE_PATH" in my bash prompt (either my account or root), I have nothing.
>
> When I run a custom guix shell (with gcc-toolchain) and I run "echo $C_INCLUDE_PATH",
> I have "/gnu/store/1p21dbv408cb45zcc15v7wj0q7x99rz2-profile/include"
>
> Without this env variable, C programs can't use "linux/limits.h" or
> other kernel related libraries. Any idea how to solve this problem ?

You say that “guix shell” sets the variable as expected.  Its value
depends on the packages you add to the “guix shell” invocation.

You can also augment it manually to add whatever include directories you
need.

-- 
Ricardo


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re : Re: no C_INCLUDE_PATH env variable defined : I can't compile C applications
  2022-10-23 21:48 ` Ricardo Wurmus
@ 2022-10-24  1:42   ` Mohamed Amine LEGHERABA
  2022-10-24  6:57     ` 宋文武
  0 siblings, 1 reply; 6+ messages in thread
From: Mohamed Amine LEGHERABA @ 2022-10-24  1:42 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix

Thanks Ricardo for your answer.

Sorry if my message was not clear,
I don't have the env variable C_INCLUDE_PATH in my guix system and I should have it because I have the packages "gcc-toolchain" and "linux-libre-headers" in my home profile.
When I run a instance of guix shell with these 2 packages, for example with the command "guix shell gcc-toolchain linux-libre-headers" I do have this env variable defined (in fact a guix shell with only gcc-toolchain works also) so I don't know why I don't have this variable defined in my system.




------- Original Message -------
Le dimanche 23 octobre 2022 à 11:48 PM, Ricardo Wurmus <rekado@elephly.net> a écrit :


> Mohamed Amine LEGHERABA via help-guix@gnu.org writes:
> 
> > When I do "echo $C_INCLUDE_PATH" in my bash prompt (either my account or root), I have nothing.
> > 
> > When I run a custom guix shell (with gcc-toolchain) and I run "echo $C_INCLUDE_PATH",
> > I have "/gnu/store/1p21dbv408cb45zcc15v7wj0q7x99rz2-profile/include"
> > 
> > Without this env variable, C programs can't use "linux/limits.h" or
> > other kernel related libraries. Any idea how to solve this problem ?
> 
> 
> You say that “guix shell” sets the variable as expected. Its value
> depends on the packages you add to the “guix shell” invocation.
> 
> You can also augment it manually to add whatever include directories you
> need.
> 
> --
> Ricardo


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: no C_INCLUDE_PATH env variable defined : I can't compile C applications
  2022-10-24  1:42   ` Re : " Mohamed Amine LEGHERABA
@ 2022-10-24  6:57     ` 宋文武
  2022-10-24  8:17       ` Efraim Flashner
  0 siblings, 1 reply; 6+ messages in thread
From: 宋文武 @ 2022-10-24  6:57 UTC (permalink / raw)
  To: Mohamed Amine LEGHERABA; +Cc: Ricardo Wurmus, help-guix

Mohamed Amine LEGHERABA <mlegheraba@protonmail.com> writes:

> Thanks Ricardo for your answer.
>
> Sorry if my message was not clear,
> I don't have the env variable C_INCLUDE_PATH in my guix system and I
> should have it because I have the packages "gcc-toolchain" and
> "linux-libre-headers" in my home profile.
> When I run a instance of guix shell with these 2 packages, for example
> with the command "guix shell gcc-toolchain linux-libre-headers" I do
> have this env variable defined (in fact a guix shell with only
> gcc-toolchain works also) so I don't know why I don't have this
> variable defined in my system.

Hello, I think you're missing 'home-bash-service-type' in your home
services, which should setup bash to source
'$HOME_ENVIRONMENT/setup-environment', and 'setup-environment' will
source '.guix-home/profile/etc/profile'.  If gcc-toolchain is in the
home profile, that '.guix-home/profile/etc/profile' should have
C_INCLUDE_PATH in it.

Hope this helps!


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: no C_INCLUDE_PATH env variable defined : I can't compile C applications
  2022-10-24  6:57     ` 宋文武
@ 2022-10-24  8:17       ` Efraim Flashner
  2022-10-29 12:24         ` Re : " Mohamed Amine LEGHERABA
  0 siblings, 1 reply; 6+ messages in thread
From: Efraim Flashner @ 2022-10-24  8:17 UTC (permalink / raw)
  To: 宋文武
  Cc: Mohamed Amine LEGHERABA, Ricardo Wurmus, help-guix

[-- Attachment #1: Type: text/plain, Size: 1373 bytes --]

On Mon, Oct 24, 2022 at 02:57:57PM +0800, 宋文武 wrote:
> Mohamed Amine LEGHERABA <mlegheraba@protonmail.com> writes:
> 
> > Thanks Ricardo for your answer.
> >
> > Sorry if my message was not clear,
> > I don't have the env variable C_INCLUDE_PATH in my guix system and I
> > should have it because I have the packages "gcc-toolchain" and
> > "linux-libre-headers" in my home profile.
> > When I run a instance of guix shell with these 2 packages, for example
> > with the command "guix shell gcc-toolchain linux-libre-headers" I do
> > have this env variable defined (in fact a guix shell with only
> > gcc-toolchain works also) so I don't know why I don't have this
> > variable defined in my system.
> 
> Hello, I think you're missing 'home-bash-service-type' in your home
> services, which should setup bash to source
> '$HOME_ENVIRONMENT/setup-environment', and 'setup-environment' will
> source '.guix-home/profile/etc/profile'.  If gcc-toolchain is in the
> home profile, that '.guix-home/profile/etc/profile' should have
> C_INCLUDE_PATH in it.
> 
> Hope this helps!

or the zsh home service, since I see you're using zsh.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re : Re: no C_INCLUDE_PATH env variable defined : I can't compile C applications
  2022-10-24  8:17       ` Efraim Flashner
@ 2022-10-29 12:24         ` Mohamed Amine LEGHERABA
  0 siblings, 0 replies; 6+ messages in thread
From: Mohamed Amine LEGHERABA @ 2022-10-29 12:24 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 宋文武, Ricardo Wurmus, help-guix

Thanks guys, I tested with bash home service, and restarted my computer and now It's working. Before I was using zsh and zsh home service but it was broked for some reasons, maybe I played to much with the config files ^^.

Thanks,
Mohamed Amine LEGHERABA

------- Original Message -------
Le lundi 24 octobre 2022 à 10:17, Efraim Flashner <efraim@flashner.co.il> a écrit :


> On Mon, Oct 24, 2022 at 02:57:57PM +0800, 宋文武 wrote:
> 
> > Mohamed Amine LEGHERABA mlegheraba@protonmail.com writes:
> > 
> > > Thanks Ricardo for your answer.
> > > 
> > > Sorry if my message was not clear,
> > > I don't have the env variable C_INCLUDE_PATH in my guix system and I
> > > should have it because I have the packages "gcc-toolchain" and
> > > "linux-libre-headers" in my home profile.
> > > When I run a instance of guix shell with these 2 packages, for example
> > > with the command "guix shell gcc-toolchain linux-libre-headers" I do
> > > have this env variable defined (in fact a guix shell with only
> > > gcc-toolchain works also) so I don't know why I don't have this
> > > variable defined in my system.
> > 
> > Hello, I think you're missing 'home-bash-service-type' in your home
> > services, which should setup bash to source
> > '$HOME_ENVIRONMENT/setup-environment', and 'setup-environment' will
> > source '.guix-home/profile/etc/profile'. If gcc-toolchain is in the
> > home profile, that '.guix-home/profile/etc/profile' should have
> > C_INCLUDE_PATH in it.
> > 
> > Hope this helps!
> 
> 
> or the zsh home service, since I see you're using zsh.
> 
> --
> Efraim Flashner efraim@flashner.co.il אפרים פלשנר
> 
> GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
> Confidentiality cannot be guaranteed on emails sent or received unencrypted


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-10-29 12:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-22 11:07 no C_INCLUDE_PATH env variable defined : I can't compile C applications Mohamed Amine LEGHERABA via
2022-10-23 21:48 ` Ricardo Wurmus
2022-10-24  1:42   ` Re : " Mohamed Amine LEGHERABA
2022-10-24  6:57     ` 宋文武
2022-10-24  8:17       ` Efraim Flashner
2022-10-29 12:24         ` Re : " Mohamed Amine LEGHERABA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).