diff --git a/Others/gcc/README.md b/Others/gcc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d09c617d245230a55a7e164a6566df270ba42b1a --- /dev/null +++ b/Others/gcc/README.md @@ -0,0 +1,66 @@ +# Quick reference + +- The official GCC docker image. + +- Maintained by: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative). + +- Where to get help: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative), [openEuler](https://gitee.com/openeuler/community). + +# GCC | openEuler +Current GCC docker images are built on the [openEuler](https://repo.openeuler.org/). This repository is free to use and exempted from per-user rate limits. + +The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, Go, D, Modula-2, and COBOL +as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system. + +Learn more about GCC on [GCC Website](https://gcc.gnu.org/)⁠. + +# Supported tags and respective Dockerfile links +The tag of each `gcc` docker image is consist of the version of `gcc` and the version of basic image. The details are as follows + +| Tag | Currently | Architectures | +|----------|-------------|------------------| +|[15.1.0-oe2403sp1](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/gcc/15.1.0/24.03-lts-sp1/Dockerfile)| GCC 15.1.0 on openEuler 24.03-LTS-SP1 | amd64, arm64 | + +# Usage +In this usage, users can select the corresponding `{Tag}` based on their requirements. + +- Pull the `openeuler/gcc` image from docker + + ```bash + docker pull openeuler/gcc:{Tag} + ``` + +- Run with an interactive shell + + You can start the container with an interactive shell to run your own code using gcc. + ``` + docker run -it --rm openeuler/gcc:{Tag} bash + ``` + +- Example: A minimal gcc program + + Create a file named `hello.c` with the following content: + ``` + // hello.c + #include + + int main() { + printf("Hello from GCC %d.%d.%d\n", + __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); + return 0; + } + ``` + +- Compile the program: + Use the new version of `gcc` to compile the program: + ``` + /usr/local/gcc/bin/gcc hello.c -o hello + ``` + +- Run the program + ``` + $ ./hello + ``` + +# Question and answering +If you have any questions or want to use some special features, please submit an issue or a pull request on [openeuler-docker-images](https://gitee.com/openeuler/openeuler-docker-images). \ No newline at end of file diff --git a/Others/gcc/doc/image-info.yml b/Others/gcc/doc/image-info.yml new file mode 100644 index 0000000000000000000000000000000000000000..c8c2b92027f894bed5c5b91ac3faa70a38bfa56f --- /dev/null +++ b/Others/gcc/doc/image-info.yml @@ -0,0 +1,63 @@ +name: gcc +category: others +description: GCC (GNU Compiler Collection) 是 GNU 项目开发的一套开源编译器工具集,支持多种编程语言,是 Linux 系统中最常用的编译器。 +environment: | + 本应用在Docker环境中运行,安装Docker执行如下命令 + ``` + yum install -y docker + ``` +tags: | + gcc镜像的Tag由其版本信息和基础镜像版本信息组成,详细内容如下 + + | Tag | Currently | Architectures | + |----------|-------------|------------------| + |[15.1.0-oe2403sp1](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/gcc/15.1.0/24.03-lts-sp1/Dockerfile)| GCC 15.1.0 on openEuler 24.03-LTS-SP1 | amd64, arm64 | + +download: | + 拉取镜像到本地 + ``` + docker pull openeuler/gcc:{Tag} + ``` + +usage: | + - 使用交互式Shell运行: + + 启动一个带交互式Shell的容器,使用GCC运行自己的代码。 + ``` + docker run -it --rm openeuler/gcc:{Tag} bash + ``` + + - 个最简单的GCC程序 + + 创建一个名为hello.c的文件,内容如下: + ``` + // hello.c + #include + + int main() { + printf("Hello from GCC %d.%d.%d\n", + __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); + return 0; + } + ``` + + - 编译程序: + 使用新版本的gcc编译程序: + ``` + /usr/local/gcc/bin/gcc hello.c -o hello + ``` + + - 运行程序 + ``` + $ ./hello + ``` + +license: GPLv3 +similar_packages: + - G++: G++是GNU C++编译器(GNU C++ Compiler),属于GCC(GNU Compiler Collection)的一部分,专门用于编译C++代码。 +dependency: + - gmp + - mpfr + - mpc + - gettext + - isl \ No newline at end of file diff --git a/Others/gcc/doc/picture/logo.png b/Others/gcc/doc/picture/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d3a6e5363445a1ba46ab02ce653342b4a3163365 Binary files /dev/null and b/Others/gcc/doc/picture/logo.png differ